24 Yii::import(
'booster.widgets.TbBaseInputWidget');
66 list($name, $id) = $this->resolveNameID();
70 $this->htmlOptions[
'id'] = $id;
73 if ($this->hasModel()) {
75 echo $this->form->textField($this->model, $this->attribute, $this->htmlOptions);
77 echo CHtml::activeTextField($this->model, $this->attribute, $this->htmlOptions);
80 echo CHtml::textField($name, $this->
value, $this->htmlOptions);
97 $options = !empty($this->format) ? CJavaScript::encode(array(
'format' => $this->format)) :
'';
100 echo
"jQuery('#{$id}').colorpicker({$options})";
101 foreach ($this->events as $event => $handler) {
102 echo
".on('{$event}', " . CJavaScript::encode($handler) .
")";
105 Yii::app()->getClientScript()->registerScript(__CLASS__ .
'#' . $this->getId(), ob_get_clean() .
';');