CListView

Guys how do I get CListView to list data matching a specific column. For example if i have a sex coloum in the model Clistview is rendering. By default it will show all the contents of Model. But how do I get it to display all the details for only those rows who’s sex is Male.

Help!

specify criteria in CActiveDataProvider.

if you use standard $model->search() function just set filter through attributes:




$model->sex = SEX_MALE;

...

$this->widget( 'CListView', array( 'dataProvider'=>$model->search() ) );



can explain this code further?cz i also face this problem.