Cgridview Conditions

Hi need help about adding a condition in cgridview in admin

What kind of condition?

Open your model that constructs your cgridview. go to the search() method and add condition such as $criteria->condition = ‘a=b’. This is just an example! Hope it helps

for example you have col1 and i want to view only all col1 that have a value of 1

You have to define this condition in criteria’s attribute of CActiveDataProvider

u can use the


 'value' => '($data["active"] == 1 ? " ":"abc")',