Yii Framework Forum: Dependent Multidropdown - Yii Framework Forum

Jump to content

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

Dependent Multidropdown Rate Topic: -----

#1 User is offline   Sukhwinder 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 51
  • Joined: 27-October 09

Posted 01 January 2013 - 05:02 AM

I want to make two drop down

1. Select Group
2. Select Members (multi Drop Down)

When user select the first drop down (Group), i want to populate the Members Multidropdowen with the members of selected Group dynamically.

Select Members is a multidropdown and User can select more then One members.

I am able to accomplish dependent drop-down, or an independent Multidropdown, but i am not able to integrate these two.
I have tried the extensions http://www.yiiframew...on/emultiselect and http://www.yiiframew.../echmultiselect etc

Kinldy help me out
0

#2 User is offline   Kollipara Rama Krishna 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 16
  • Joined: 12-May 12

Posted 02 January 2013 - 05:36 AM

i think that you can use dependent dropdown and use multiple=multiple attribute in members drop downlist
0

#3 User is offline   kaplievabell 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 29-May 13

Posted 29 May 2013 - 05:06 PM

Took me a while to figure out how to update dependent multiselect. I am using http://www.yiiframew.../echmultiselect

For parent dropDownBox do as u would regulatory for dynamic dropDownBox. For the multiselect allow ajaxRefresh. Here is how my code looks:

First dropDownBox:

$project_all = new Project();
echo $form->dropDownList($project_all, 'id', CHtml::listData(
Project::model()->findAll(), 'id', 'project_name'), array('prompt' => 'Выберите проект',
'ajax' => array(
'type' => 'POST',
'url' => CController::createUrl('sites/displayProjectSitesDemandCar'),
'update' => '#Waybill_site_id',
// 'success'=>'function(data) {}'
)));

multiselect:

$this->widget('ext.EchMultiselect.EchMultiselect', array(
'model' => $model,
'dropDownAttribute' => 'site_id',
'data' => array(),
'dropDownHtmlOptions' => array(
'style' => 'width:378px;',
),
'options' => array(
'header'=> true,
'noneSelectedText'=>'Выберите сайт',
'uncheckAllText'=>'Очистить все',
'selectedText'=> '# выбрано',
'classes'=>'dynamic_multiselect',
'ajaxRefresh'=>true, //this will update multiselect dynamically :D
),
));
0

#4 User is offline   jorgito_ml 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 12
  • Joined: 01-June 12

Posted 05 March 2014 - 01:26 PM

View Postkaplievabell, on 29 May 2013 - 05:06 PM, said:

Took me a while to figure out how to update dependent multiselect. I am using http://www.yiiframew.../echmultiselect

For parent dropDownBox do as u would regulatory for dynamic dropDownBox. For the multiselect allow ajaxRefresh. Here is how my code looks:

First dropDownBox:

$project_all = new Project();
echo $form->dropDownList($project_all, 'id', CHtml::listData(
Project::model()->findAll(), 'id', 'project_name'), array('prompt' => 'Выберите проект',
'ajax' => array(
'type' => 'POST',
'url' => CController::createUrl('sites/displayProjectSitesDemandCar'),
'update' => '#Waybill_site_id',
// 'success'=>'function(data) {}'
)));

multiselect:

$this->widget('ext.EchMultiselect.EchMultiselect', array(
'model' => $model,
'dropDownAttribute' => 'site_id',
'data' => array(),
'dropDownHtmlOptions' => array(
'style' => 'width:378px;',
),
'options' => array(
'header'=> true,
'noneSelectedText'=>'Выберите сайт',
'uncheckAllText'=>'Очистить все',
'selectedText'=> '# выбрано',
'classes'=>'dynamic_multiselect',
'ajaxRefresh'=>true, //this will update multiselect dynamically :D
),
));


Can you post your function: 'url' => CController::createUrl('sites/displayProjectSitesDemandCar'),???
Thx!
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