Problem is that category.name isn’t field of model, it is field of related table.
In my model:
public function relations()
{
return array(
'category'=>array(self::BELONGS_TO, 'MessageCategory', 'category_id'),
);
}
I need to filter list by ‘name’ attribute of related ‘Category’ AR.
CGridView provides posibility to output this values in grid (‘name’=>‘categoty.name’). But when I add any valid value to ‘filter’ of the column, filter input don’t displays and don’t generate any errors.
Somebody tried to make filter for column which displays value from related ActiveRecord?
For example: If I add ‘filter’=>array(‘1’=>‘first’,‘2’=>‘second’) to any column that displays fields of model passed to CGridView->filter and CGridView->dataProvider, CGridView draws ‘select’ tag with corresponding items. But when I write it in column that displays data from related AR (‘category.name’), CGridView don’t draws ‘select’ tag at the header of this column