Cgridview Filter Reset Error - After Clicking In Pager

This applies for CGridView, TbGridView on Safari, Chrome and Mozilla browsers. No idea about other browsers

I am able to display the results in grid view, filter is working fine and page control is working fine but in the below scenario , I am not able unselect the selected filter value.

  1. Open Grid page

  2. Filter a Column

  3. Click on the Page control to Navigate.

  4. Change filter (This step is not working) - Filter value is not changing until I refresh the page(until calling the action again)

Does any one experienced the same issue ? It looks like a bug?

I haven’t run into this issue. Can you post your relevant view/controller/model code?

I also have this problem.

You have to repeat the filter after switching to another page (Gridview Page Navigate).

Detail code for this bug:

Controller:




public function actionAdmin($case = 'normal')

{	   

	if ($case == 'normal')

	{

		$model = new MBPGeneral('search');

		$model->unsetAttributes();  

		if (isset($_GET['MBPGeneral']))

			$model->attributes = $_GET['MBPGeneral'];

		

		$this->render('admin', array(

			'model' => $model,

		));

	}

}

View:


<?php

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

	'id'           => 'bp_general_grid',

	'dataProvider' => $model->search(),

	'filter'       => $model,

	'columns'      => array(

		'id',

		'name',

	),

)); ?>

Thanks,

Using a [size=2]browser inspector, what URL is the grid sending its update to a[/size][size=2]fter setting the filter and paging to a new page? Any 404s?[/size]

My results after testing:


1. Search page 1:

localhost/ERP/bp/Customer/Admin?MBPGeneral%5Bcode%5D=&amp;MBPGeneral%5BcustomerM%5D=88&amp;MBPGeneral%5Bcontact_person_id%5D=&amp;MBPGeneral%5Bcity%5D=&amp;MBPGeneral%5Bbp_group_id%5D=&amp;MBPGeneral%5Bstatus_id%5D=1&amp;MBPGeneral%5Bpriority_id%5D=&amp;MBPGeneral_page=1&amp;ajax=bp_general_grid


2. No search on page 1:

localhost/ERP/bp/Customer/Admin?MBPGeneral%5Bcode%5D=&amp;MBPGeneral%5BcustomerM%5D=&amp;MBPGeneral%5Bcontact_person_id%5D=&amp;MBPGeneral%5Bcity%5D=&amp;MBPGeneral%5Bbp_group_id%5D=&amp;MBPGeneral%5Bstatus_id%5D=1&amp;MBPGeneral%5Bpriority_id%5D=&amp;MBPGeneral_page=1&amp;ajax=bp_general_grid


3. Switch page 2:

localhost/ERP/bp/customer/Admin/MBPGeneral%5Bcode%5D//MBPGeneral%5BcustomerM%5D//MBPGeneral%5Bcontact_person_id%5D//MBPGeneral%5Bcity%5D//MBPGeneral%5Bbp_group_id%5D//MBPGeneral%5Bstatus_id%5D/1/MBPGeneral%5Bpriority_id%5D//MBPGeneral_page/2/ajax/bp_general_grid?ajax=bp_general_grid


4. Search on page 2:

localhost/ERP/bp/customer/Admin/MBPGeneral%5Bcode%5D//MBPGeneral%5BcustomerM%5D//MBPGeneral%5Bcontact_person_id%5D//MBPGeneral%5Bcity%5D//MBPGeneral%5Bbp_group_id%5D//MBPGeneral%5Bstatus_id%5D/1/MBPGeneral%5Bpriority_id%5D//MBPGeneral_page/2/ajax/bp_general_grid?ajax=bp_general_grid&amp;MBPGeneral%5Bcode%5D=&amp;MBPGeneral%5BcustomerM%5D=88&amp;MBPGeneral%5Bcontact_person_id%5D=&amp;MBPGeneral%5Bcity%5D=&amp;MBPGeneral%5Bbp_group_id%5D=&amp;MBPGeneral%5Bstatus_id%5D=1&amp;MBPGeneral%5Bpriority_id%5D=&amp;MBPGeneral_page=1