Specifying a custom filtering for a relational column in a CGridView

I’m using a CGridView generated by Gii’s CRUD generator, and customized one of the columns to show a related model’s attribute.

What happened is that the ability to filter by that column is now gone. (In the example: Venue)

How can I specify a way to filter the column?

I’d prefer to build a <select> with possible options, but a string filter would be fine too.

// $model is an Event, which BELONGS_TO Venue.

$this->widget('zii.widgets.grid.CGridView', array(








		'Venue.name', // <-- this one. originally was 'venue' I.E. Event's foreign key pointing to venues.






Hi, petruza,

I’d like to recommend you to read this wiki.