Exclude Records From Cgridview But Keep Filter Feature Unaffected

Well,

Presume I need to "hide" or exclude certain records from CGridView but I would like to maintain filters and advanced search.

I have problems with that.

If my search criteria have a "static" condition like this for instance:

$criteria->condition = (‘t.id > 1’);

then filters and advanced search stop working. It looks like the static condition specified in search criteria completely overwrites search criteria sent from "admin" page.

So, the question is - how to exclude certain records from being shown in grid view?

For your info - I am talking about "system accounts" what should be hidden form praying eyes…

Any ideas???

OK - I’ve got it !

Simply - the "static" condition must be specified before any $criteria->compare().

Then all features work as expected .