Cgridview And Search Form With Different Filters

Hello All

I will keep this quite abstract as I believe (hope) this is a general problem with easy work-around. I have modified a gii generated admin page as followed. The search form is modified to select records pertaining to a given user. This works, and when searching the grid updates fine.

I have customized the output of the grid to contain various user related data, for example each record reflecting some user data.

When I use the grid filters (to the top of the widget) the filter results fine, however I lose the original filter of the user.

So, I query the user and it selects some some results and when I want to filter these results on some other criteria it produces the results generated from the entire dataset, rather than the user-filtered results.

A side note, I have tried installing http://www.yiiframework.com/extension/remember-filters-gridview/

This actually produces some result, as when I filter as specified above it does not work, but when I refresh the page, the results are exactly as desired as it has saved both filters from the previous session.

Hope this is clear, And please help! Thank you

Hi

It is not very clear what you want to achieve, but I think that you want to have a table indicating for instance the User’s posts (so with Posts as the main table) while having the possibility to still search on the User’s name.

Check out the extension that I just shared:

RelatedSearchBehavior