problems with CGridView using my own search on model

i’m using CGridView with my own search function in the model, data retrieves properly but filters are not working, basically i have clone “search” function but the behavior is different and i dont know why, this is may code


$this->widget(‘zii.widgets.grid.CGridView’, array(









$modRespSearchC=new Responsables(‘searchCargo’);





public function searchCargo()


    $criteria=new CDbCriteria;


    return new CActiveDataProvider($this, array(




how you can see is very basic, work but not filtering, what i’m missing??

In your searchCargo() method, your critera is only build by comparing ‘cargoResp’,

but the other attributes/columns values apell1Resp, apell2Resp are ignored.

Add compare criteria for the other searchable attributes to.

Check also the rules() if all are safe on search.

Add properly rules for your’s model scenario