Yii Framework Forum: Exclude Records From Cgridview But Keep Filter Feature Unaffected - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Exclude Records From Cgridview But Keep Filter Feature Unaffected Rate Topic: -----

#1 User is offline   Ziggi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 95
  • Joined: 14-August 12

Posted 14 January 2013 - 09:14 PM

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???
0

#2 User is offline   Ziggi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 95
  • Joined: 14-August 12

Posted 14 January 2013 - 09:44 PM

OK - I've got it !

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

Then all features work as expected .
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users