Cgridview Filtering Problem

Hi,

I have model Package and a model Item with a MANY_MANY relationship (Items can be assigned to multiple Packages or none, Packages have multiple Items, there’s a package_item table in the database for it). In a Package view I want to display a table with Items assigned to the Package and a table with Items that aren’t assigned to it yet.

My dataprovider for the first table is


Item::model()->search($model->items, true);

and


Item::model()->search($model->items, false);

for the second one (I modified search() in models/Item). This works as I want.

But I have a problem finding out what to specify for the filter property of both CGridViews. $model doesn’t work as it’s Package not Item and Item::model() shows the search input fields/drop-down lists but doesn’t filter anything.

Thanks in advance