Cgridview Filter $Data

Hi guys,

I have tried in Cgridview


                

array (

'type'=>'raw',

'name'=>'jobGrade',

'filter' => '$data->jobGradeData'



,

The $data->jobGradeData is actually a dropdown list which I populated using

afterFind(). The reason why i did this was that I want the dropdown list to only show

the value that is available in the table or for a specific search parameters.

I notice that in cgridview, filter does not render $data->jobGradeData. It displays

"$data->jobGradeData"

Any solutions for me?


'filter' => $model->jobGradeData

Matt

Hi Matt,

Thanks. But that is not what I want. When you call $model->jobGradeData, it is

initialized as a new object. What I want is $data->jobGradeData. This $data->jobGradeData

will return an array of dropdown list value which is generated by the afterFind() functions

in cgridview. I notice that we are able to add ‘$data->jobGradeData’ in cgridview column value

but not in filter because filter does not render ‘$data’.

If $data->jobGradeData return an array, then think about to use




'filter'=>CHtml::dropDownList($data->jobGradeData)