sukhman4
(Sukhman4)
1
I want to make two drop down
-
Select Group
-
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.yiiframework.com/extension/emultiselect and http://www.yiiframework.com/extension/echmultiselect etc
Kinldy help me out
i think that you can use dependent dropdown and use multiple=multiple attribute in members drop downlist
Took me a while to figure out how to update dependent multiselect. I am using http://www.yiiframework.com/extension/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',
[b]'ajaxRefresh'=>true,[/b] //this will update multiselect dynamically <img src='http://www.yiiframework.com/forum/public/style_emoticons/default/biggrin.gif' class='bbc_emoticon' alt=':D' />
),
));
Can you post your function: ‘url’ => CController::createUrl(‘sites/displayProjectSitesDemandCar’),
Thx!