This extension adds a multiselect dropdown list. It implements all options of jQuery MultiSelect To use this widget, you may insert the following code in a view:
$this->widget('ext.multiselect.JMultiSelect',array(
'model'=>$model,
'attribute'=>'attribute',
'data'=>$data,
// additional javascript options for the MultiSelect plugin
'options'=>array()
));
Nice !
Also check
http://www.yiiframework.com/extension/emultiselect
for a similar jquery plugin!
code error
nice extension, good job
theres a code error
i was getting an error "citysFilter" ??? maybe it was coded for city dropdown list
anyway this is a pretty nice tool :) again keep up the good work.
//echo CHtml::activeDropDownList($this->model, 'citysFilter', $this->data, $this->htmlOptions);
echo CHtml::activeDropDownList($this->model, $this->attribute, $this->data, $this->htmlOptions);
and change the init function string (noneSelectedText and selectedText) to something meaningfull
/** * Initializes the widget. */ public function init() { parent::init(); $this->registerScripts(); $this->htmlOptions['multiple'] = 'multiple'; $this->options = array_merge(array( 'header' => false, 'selectedList' => 4, 'noneSelectedText' => 'Select an option', 'selectedText' => '# selected', ), $this->options); }
Pre selected items
how to pass array for items to be set as preselected or pre-checked. Is there any parameter to set in options array....? Please guide..its urgent
nice extension also you can create custom multiselect by ajax (using tokenizer js).
http://www.jqueryrain.com/2014/09/tokenize-jquery-select-multiple-items-autocomplete/ download this plugin and add his js and css in your code
Yii::app()->clientScript->registerScriptFile(Yii::app()->theme->baseUrl . '/js/jquery.tokenize.js', CClientScript::POS_END); Yii::app()->clientScript->registerCssFile(Yii::app()->theme->baseUrl . '/css/jquery.tokenize.css');
and in view place :
in js write :
$('#tokenize').tokenize({ datas: SITE_URL+"user/selectUser/", });
this also work fine for me and easy to integrate cheers. :)
});
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.