/** * 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); }