Yii Framework Forum: Jmultiselect2Side Selected List - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Jmultiselect2Side Selected List how to display selected list in ms2side__dx option Rate Topic: -----

#1 User is offline   Fadi Jaatheen 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 02-January 13

Posted 02 January 2013 - 08:17 AM

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
0

#2 User is offline   Praveen Gurjar 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 23-March 10
  • Location:Noida, India

Posted 09 May 2013 - 07:28 AM

I am also facing the same issue
0

#3 User is offline   Praveen Gurjar 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 23-March 10
  • Location:Noida, India

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'),
));
0

#4 User is offline   Narender Negi 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 13-March 13
  • Location:Chandigarh

Posted 02 August 2013 - 02:48 AM

I tried it but it does not display selected id in selected option it dislay ids without any option field
0

#5 User is offline   SrikanthMaggidi 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 8
  • Joined: 19-May 14
  • Location:Hyderabad,India

Posted 21 May 2014 - 04:48 AM

Please find the Best solution here to save the selected values in jmultiselect2side widget

http://www.yiiframew...-widget-in-yii/ 


Thanks
Srikanth
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users