I am using jmultiselect2side yii extension, i dont find the option will show selected list upadted, the code example is:
$this->widget('application.extensions.jmultiselect2side.Jmultiselect2side',array(
'model'=>$model,
'attribute'=>'gossip_id', //selected items
'labelsx'=>'Disponible',
'labeldx'=>'Gossip Selected',
'moveOptions'=>false,
'autoSort'=>'true',
'search' =>'Search:',
'list'=>CHtml::listData( // available items
$gossips,
'gossip_id',
'gossip_name'),
));
in action update cant show me the updated list(seleceted items), please help me
Page 1 of 1
Jmultiselect2Side Selected List how to display selected list in ms2side__dx option
#3
Posted 10 May 2013 - 05:20 AM
Just add a field public $selectedOptions; into Jmultiselect2side.php. Now add this to line no 170 like "foreach (array('selectedPosition', 'labelTop', 'labelBottom', 'labelUp', 'labelDown', 'labelSort', 'maxSelected', 'labelsx', 'labeldx', 'autoSort', 'selectedOptions') as $p) {".
Now go to the jquery.multiselect2side.js file and "selectedOptions" like o = $.extend({
selectedOptions:'',
selectedPosition: 'right',
moveOptions: true,
labelTop: 'Top',
labelBottom: 'Bottom',
labelUp: 'Up',
labelDown: 'Down',
labelSort: 'Sort',
labelsx: 'Available',
labeldx: 'Selected',
maxSelected: -1,
autoSort: false
}, o);
Now in line no 84 of jquery.multiselect2side.js use selectedOptions like this:
"<select title='" + o.labeldx + "' name='" + nameDx + "' id='" + nameDx + "' size='" + size + "' multiple='multiple' >"+o.selectedOptions+"</select>" +
Now go to your controller and make string of all selected options and pass that to view. In view add selectedOptions option as under:
$this->widget('application.extensions.jmultiselect2side.Jmultiselect2side', array(
'model' => $model,
'attribute' => 'groupDevices', //selected items
'labelsx' => 'Available',
'labeldx' => 'Selected',
'moveOptions' => true,
'autoSort' => 'true',
'selectedOptions' => $selectedOptions,
'list' => CHtml::listData(// available items
$deviceModel, 'deviceId', 'hostname'),
));
Now go to the jquery.multiselect2side.js file and "selectedOptions" like o = $.extend({
selectedOptions:'',
selectedPosition: 'right',
moveOptions: true,
labelTop: 'Top',
labelBottom: 'Bottom',
labelUp: 'Up',
labelDown: 'Down',
labelSort: 'Sort',
labelsx: 'Available',
labeldx: 'Selected',
maxSelected: -1,
autoSort: false
}, o);
Now in line no 84 of jquery.multiselect2side.js use selectedOptions like this:
"<select title='" + o.labeldx + "' name='" + nameDx + "' id='" + nameDx + "' size='" + size + "' multiple='multiple' >"+o.selectedOptions+"</select>" +
Now go to your controller and make string of all selected options and pass that to view. In view add selectedOptions option as under:
$this->widget('application.extensions.jmultiselect2side.Jmultiselect2side', array(
'model' => $model,
'attribute' => 'groupDevices', //selected items
'labelsx' => 'Available',
'labeldx' => 'Selected',
'moveOptions' => true,
'autoSort' => 'true',
'selectedOptions' => $selectedOptions,
'list' => CHtml::listData(// available items
$deviceModel, 'deviceId', 'hostname'),
));
Share this topic:
Page 1 of 1

Help











