Cgridview Filter Not Working

Hello everyone! Im having a bot of a problem here…

I have a CGridView widget, complete with the required models and everything. I configured the models to filter the data properly and everything works. However, I noticed something.

When I place a data in the Filtering text box, the data is filtered properly. When I remove the data to reset the table, it also works properly. However, when I try to filter the data again after going to the next page, it just doesn’t work. No errors, no filtering, nothing.

I also noticed that the pagination changes its url after resetting the table from this one:

to this one:[companyId]//DealModel[id]//DealModel[referenceCode]//



I searched the net for answers but to no avail. Can I kindly ask for assistance? Thank you!

Turns out I just have to add an ajaxurl property to my CGridVIew…

‘ajaxUrl’=>Yii::app()->createUrl( ‘deal/default/index’ ),

After that, everything will be ok. Hope this post will help somebody in the future… :slight_smile:

The issue was caused by you refresh the whole page instead of using Ajax to refresh part of page. In this case, we have to think about to use:

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



	'ajaxUpdate' => FALSE,  //this not call ajax update, will refresh whole page.