/** * Ensure that the ID attribute is rendered and registers the javascript code * for initializing the active control. */ protected function addAttributesToRender($writer) { parent::addAttributesToRender($writer); $cs = $this->getPage()->getClientScript(); if ($this->getGhosting() == TDraggableGhostingOptions::SuperGhosting) { $cs->registerPradoScript('dragdropextra'); } else { $cs->registerPradoScript('dragdrop'); } $writer->addAttribute('id', $this->getClientID()); $options = TJavascript::encode($this->getPostBackOptions()); $class = $this->getClientClassName(); $code = "new {$class}('{$this->getClientId()}', {$options}) "; $cs->registerEndScript(sprintf('%08X', crc32($code)), $code); }
/** * Renders the javascript for div tag. */ protected function addAttributesToRender($writer) { parent::addAttributesToRender($writer); $writer->addAttribute('id', $this->getClientID()); $this->getPage()->getClientScript()->registerPradoScript('prado'); $this->getPage()->getClientScript()->registerPradoScript('ajax'); $this->getPage()->getClientScript()->registerScriptFile('GoogleAjaxApi', 'http://www.google.com/jsapi?key=' . $this->getApiKey()); $this->getPage()->getClientScript()->registerScriptFile('B', $this->publishAsset("assets/B.js", __CLASS__)); $this->getPage()->getClientScript()->registerScriptFile('BActiveGoogleMap', $this->publishAsset("assets/BActiveGoogleMap.js", __CLASS__)); //$this->getPage()->getClientScript()->registerScriptFile('GMap.js','http://maps.google.com/maps?file=api&v=2&key='.$this->getApiKey()); //$url = $this->getPage()->getClientScript()->registerJavascriptPackages(dirname(__FILE__) . "/assets",array('activegooglemap')); //$this->getPage()->getClientScript()->registerScriptFile($url, $url); $this->getActiveControl()->registerCallbackClientScript($this->getClientClassName(), $this->getClientOptions()); }
/** * Adds attribute id to the renderer. * @param THtmlWriter the writer used for the rendering purpose */ protected function addAttributesToRender($writer) { $writer->addAttribute('id', $this->getClientID()); parent::addAttributesToRender($writer); }
/** * Ensure that the ID attribute is rendered and registers the javascript code * for initializing the active control. */ protected function addAttributesToRender($writer) { parent::addAttributesToRender($writer); $writer->addAttribute('id', $this->getClientID()); $this->getPage()->getClientScript()->registerPradoScript('dragdrop'); $this->getActiveControl()->registerCallbackClientScript($this->getClientClassName(), $this->getPostBackOptions()); }
/** * Adds background-position and background-image style attributes. * * Adds attribute name-value pairs to renderer. * This method overrides the parent implementation with additional textbox specific attributes. * @param THtmlWriter the writer used for the rendering purpose */ protected function addAttributesToRender($writer) { parent::addAttributesToRender($writer); $offset = $this->getBackOffset(); $writer->addStyleAttribute('background-position', "0 -{$offset}px"); $url = trim($this->getBackImageUrl()); $writer->addStyleAttribute('background-image', 'url(' . $url . ')'); }