hi there,
in my view, i have:
echo $form->dropDownListRow($model, 'department_id', $departments, array(
'prompt' => '> Select Department',
'ajax' => array(
'type' => 'GET',
'url' => CController::createUrl('departmentajax'),
'update' => '#workflows',
'data' => array('department_id' => 'js:this.value'),
)));
echo $form->checkBoxListInlineRow(
$model, 'workflows', CHtml::listData(Workflow::model()->findAll(), 'id', 'name')
);
The idea is every department in the dropdown list, has some workflows related.
how i can show checkboxes depends to the dropdownlist selection.
in my controller:
$sql = 'SELECT workflow.id, workflow.name FROM workflow INNER JOIN department_workflow
ON workflow.id=department_workflow.workflow_id
WHERE department_workflow.department_id='.$department_id;
$result = Yii::app()->db->createCommand($sql)->queryAll();
$listdata = CHtml::listData($result, 'id', 'name');
$listdata, should be the checkboxes that i need to show.
Thank you!