I wish to make a dropdown box on a CGridView dependant on the selection of another. This is not particularly difficult to do in forms and I have done so on several but I cannot find a way to add the ajax behaviour to the filter dropdown as it is never specifically declared, it is just an element in the column array. Can anyone tell me where in the declaration of the CGridView I can add the jquery ajax call. Here is a section of the code:
$this->widget(‘zii.widgets.grid.CGridView’, array(
‘id’ => ‘event-grid’,
‘dataProvider’ => $model->search(),
‘filter’ => $model,
‘columns’ => array(
//‘idevent’,
array(
‘name’ => ‘idsystem’,
‘value’ => ‘GxHtml::valueEx($data->idsystem0)’,
‘filter’ => GxHtml::listDataEx(System::model()->findAllAttributes(null, true)),
),
array(
‘name’ => ‘idequipment’, //I WANT THIS FILTER DROPDOWN TO BE DEPENDANT ON THE PREVIOUS COLUMNS FILTER DROPDOWN
‘value’ => ‘GxHtml::valueEx($data->idequipment0)’,
‘filter’ => GxHtml::listDataEx(Equipment::model()->findAllAttributes(null, true)),
),
//array(
//‘name’ => ‘Summary’,
// ‘value’ => ‘model()->getSummary()’,
//‘filter’ => GxHtml::listDataEx(Equipment::model()->findAllAttributes(null, true)),
// ),
‘description’,
‘startdate’,
//‘Starttime’,
‘enddate’,
//‘endtime’,
array(
‘name’ => ‘idseverityonequip’,
‘value’ => ‘GxHtml::valueEx($data->idseverityonequip0)’,
‘filter’ => GxHtml::listDataEx(SeverityOnEquipment::model()->findAllAttributes(null, true)),
),
array(
‘name’ => ‘idseverityonsystem’,
‘value’ => ‘GxHtml::valueEx($data->idseverityonsystem0)’,
‘filter’ => GxHtml::listDataEx(SeverityOnSystem::model()->findAllAttributes(null, true)),
),
array(
‘class’ => ‘CButtonColumn’,
),
),
));
?>
Thanks in advance to anyone who reads this and hopefully someone will have the answer.