Yii Framework Forum: Cgridview Filter Reset Error - After Clicking In Pager - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Cgridview Filter Reset Error - After Clicking In Pager Rate Topic: -----

#1 User is offline   venuk 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 25
  • Joined: 15-February 13

Posted 28 March 2013 - 01:49 PM

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?
0

#2 User is offline   waterloomatt 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 545
  • Joined: 09-April 10

Posted 28 March 2013 - 09:59 PM

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

#3 User is offline   trqson 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 12-December 12
  • Location:Vietnam

Posted 14 May 2013 - 08:44 PM

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,
0

#4 User is offline   waterloomatt 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 545
  • Joined: 09-April 10

Posted 15 May 2013 - 07:26 AM

Using a browser inspector, what URL is the grid sending its update to after setting the filter and paging to a new page? Any 404s?
0

#5 User is offline   trqson 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 12-December 12
  • Location:Vietnam

Posted 16 May 2013 - 01:12 AM

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

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users