Prado\Web\UI\ActiveControls\TActiveTextBox::addAttributesToRender PHP Метод

addAttributesToRender() защищенный Метод

Ensure that the ID attribute is rendered and registers the javascript code for initializing the active control.
protected addAttributesToRender ( $writer )
    protected function addAttributesToRender($writer)
    {
        parent::addAttributesToRender($writer);
        $writer->addAttribute('id', $this->getClientID());
        $this->getActiveControl()->registerCallbackClientScript($this->getClientClassName(), $this->getPostBackOptions());
    }

Usage Example

Пример #1
0
 /**
  * Ensure that the ID attribute is rendered and registers the javascript code
  * for initializing the active control. Also registers language specific global
  * settings for the first used date picker.
  */
 protected function addAttributesToRender($writer)
 {
     $cs = $this->getPage()->getClientScript();
     if (self::$_first) {
         $code = "jQuery(document).ready(function(){jQuery.datepicker.setDefaults(jQuery.datepicker.regional['{$this->getCurrentCulture()}']);});";
         $cs->registerEndScript(sprintf('%08X', crc32($code)), $code);
         self::$_first = false;
     }
     parent::addAttributesToRender($writer);
     $options = TJavaScript::encode($this->getOptions()->toArray());
     $code = "jQuery('#" . $this->getWidgetID() . "')." . $this->getWidget() . "(" . $options . ");";
     $cs->registerEndScript(sprintf('%08X', crc32($code)), $code);
 }