/** * @inheritdoc */ public function init() { parent::init(); $this->registerPlugin('button'); Html::addCssClass($this->options, 'btn-group'); $this->options['data-toggle'] = 'buttons'; }
public function getConfig(&$config) { if ($this->isSelected()) { $config['selected'] = true; } return parent::getConfig($config); }
public function getConfig(&$config) { if ($this->selected) { $config['selected'] = $this->selected; } return parent::getConfig($config); }
public function init() { parent::init(); $attrs = array(); CHtml::resolveNameID($this->model, $this->source, $attrs); $options = CJavaScript::encode(array('source' => $attrs['id'], 'destination' => $this->id, 'urlSeparator' => $this->divider)); Yii::app()->clientScript->registerScriptFile($this->assets . '/jquery.synctranslit.js')->registerScriptFile($this->assets . '/alias.js')->registerScript($this->id . '_alias', "\$('#{$this->id}').alias({$options});"); }
public function init() { parent::init(); $options = CJavaScript::encode(array( 'no_results_text' => "Выберите один из вариантов", 'allow_single_deselect'=> true, 'onChange' => $this->onchange )); Yii::app()->clientScript->registerScriptFile($this->assets . '/chosen.jquery.js')->registerCssFile( $this->assets . '/chosen.css')->registerScript( $this->id . '_chosen', "$('#{$this->id}').chosen($options);"); }
public function init() { parent::init(); $options = CJavaScript::encode(array( 'checkedLabel' => $this->checkedLabel, 'uncheckedLabel' => $this->uncheckedLabel, 'onChange' => $this->onChange, )); Yii::app()->clientScript ->registerScriptFile($this->assets . '/iphone-style-checkboxes.js') ->registerCssFile($this->assets . '/style.css')->registerScript( $this->id . '_iphone_checkbox', "$('#{$this->id}').iphoneStyle($options);"); }
public function getConfig(&$config) { $o = []; foreach ($this->fields as $field) { $label = $field->getLabel(); $data = $field->getField()->getValue(); $o[] = ['data' => $data, 'label' => $label]; } $config['options'] = $o; return parent::getConfig($config); }
public function getConfig(&$config) { if ($this->useInputTag) { $config['useInputTag'] = true; } $config['type'] = $this->input->getAttribute('type'); return parent::getConfig($config); }
public function getConfig(&$config) { if ($this->isMultiline()) { $config['multiline'] = true; } else { $type = $this->input->getAttribute('type'); if ($type !== 'text') { $config['type'] = $type; } } if ($this->isReadOnly()) { $config['readOnly'] = true; } $placeholder = $this->input->getAttribute('placeholder'); if ($placeholder !== null) { $config['placeholder'] = $placeholder; } $maxlength = $this->input->getAttribute('maxlength'); if ($maxlength !== null) { $config['maxLength'] = $maxlength; } $autofocus = $this->input->getAttribute('autofocus'); if ($autofocus !== null) { $config['autofocus'] = true; } $required = $this->input->getAttribute('required'); $ariarequired = $this->input->getAttribute('aria-required'); if ($required !== null || $ariarequired !== null) { $config['required'] = true; } return parent::getConfig($config); }
public function getConfig(&$config) { $o = []; foreach ($this->options as $option) { $label = $option->content[0]; $data = $option->getAttribute('value'); $o[] = ['data' => $data, 'label' => $label]; } $config['options'] = $o; return parent::getConfig($config); }
public function render($name, $value, $attrs = array()) { $attrs[self::STR_CLASS] = isset($attrs[self::STR_CLASS]) ? $attrs[self::STR_CLASS] . ' date' : 'date'; return parent::render($name, $value, $attrs); }