Yii Framework Forum: Multiple Select Update Operation - Yii Framework Forum

Jump to content

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

Multiple Select Update Operation display selected values on update emultiple select Rate Topic: -----

#1 User is offline   Sivanthi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 21
  • Joined: 14-February 13
  • Location:Nagercoil, Kanya Kumari, Tamilnadu. India

Posted 16 March 2013 - 04:13 AM

hi to all,

i have just learned how to display saved multiple select values on update operation.




$tselected = explode(",",$model->columnname);

			foreach($tselected as $single)
			{
				 $testsel[$single]   = array("selected"=>"selected");
			}





from the above line columnname have id values like 1,2,3,4.................

first i changed string to array. then each array i assign selected option.



echo $form->dropDownList(
					$model,
					'test',
					$testslist,
					array('multiple'=>'multiple',
				    	'key'=>'testid', 'class'=>'multiselect','options'=>$testsel)
				); 



finally create option parameter and pass array values
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