Yii Framework Forum: Cgridview Ajax Pagination Back Button Issue - Yii Framework Forum

Jump to content

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

Cgridview Ajax Pagination Back Button Issue Rate Topic: -----

#1 User is offline   prashant.tyagi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 30
  • Joined: 14-September 12

Posted 14 September 2012 - 05:06 AM

Hi there,

When user displays my CGridView, let's say i am on page number 3 , and then click to display details of selected grid view item and then goes back with either pressing "Back" (tested in Firefox and IE) or by re-entering grid view's view, he always gets first page and order by default column.how can i retain the state of pagination.

please help me
0

#2 User is offline   alirz23 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,234
  • Joined: 08-August 12
  • Location:Durban, South Africa

Posted 14 September 2012 - 07:03 AM

by default it uses ajax for pagination you disable it by adding

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'ajaxUpdate'=>false,
.......

in your CGridView
1

#3 User is offline   softark 

  • Keep It Simple
  • Yii
  • Group: Moderators
  • Posts: 2,851
  • Joined: 16-February 11
  • Location:Japan

Posted 14 September 2012 - 07:21 AM

If you are using Yii 1.1.11 or higher, then it may be worth trying 'enableHistory'.
It should work with ajax.

http://www.yiiframew...eHistory-detail
0

#4 User is offline   prashant.tyagi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 30
  • Joined: 14-September 12

Posted 16 September 2012 - 10:33 PM

View Postsoftark, on 14 September 2012 - 07:21 AM, said:

If you are using Yii 1.1.11 or higher, then it may be worth trying 'enableHistory'.
It should work with ajax.

http://www.yiiframew...eHistory-detail


thanks softark for your reply but i am using version 1.1.9.how can i do the same in this version?
thanks in advance
0

#5 User is offline   prashant.tyagi 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 30
  • Joined: 14-September 12

Posted 16 September 2012 - 10:35 PM

View Postalirz23, on 14 September 2012 - 07:03 AM, said:

by default it uses ajax for pagination you disable it by adding

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'ajaxUpdate'=>false,
.......

in your CGridView


Hi alirz23

thanks for your reply but i have to do the same with ajax pagination. any other way?
0

#6 User is offline   bennouna 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,180
  • Joined: 05-January 12
  • Location:Morocco

Posted 17 September 2012 - 01:07 AM

View Postprashant.tyagi, on 16 September 2012 - 10:33 PM, said:

but i am using version 1.1.9

There are jQuery plugins for that. And if you check CGridView's latest source code, you can see 'enableHistory' property triggers this code:
/*lines 411-412*/
		if($this->enableHistory)
			$cs->registerCoreScript('history');


That's the same plugin: http://tkyk.github.c...history-plugin/

Pay attention to the requirements etc.
1

#7 User is offline   Krissce 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 11-November 11

Posted 05 February 2013 - 08:23 AM

Hey,
I got additional question related somehow (I use Yii 1.1.13). Imagine there is page with a CGridView with enabled history and pagination via ajax (displaying many pages):
1) user goes to for instance page 3 in grid pagination
2) then user goes to other url/page (not a grid page)
3) then users clicks back button to go back to page with grid

Grid page will display first page results for a fraction of seconds and then it will load results via ajax for page 3? Does it it have to go to page 1 and then jump to page 3? IMO on back button it should go to 3 page results directly.

Thanks,
Kris
0

#8 User is offline   gnz 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 06-May 13

Posted 16 June 2013 - 08:23 PM

View Postprashant.tyagi, on 16 September 2012 - 10:33 PM, said:

thanks softark for your reply but i am using version 1.1.9.how can i do the same in this version?
thanks in advance


I am using 1.1.10. I have the same question. Can someone shed some light?
0

#9 User is offline   bennouna 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,180
  • Joined: 05-January 12
  • Location:Morocco

Posted 17 June 2013 - 03:32 AM

View Postgnz, on 16 June 2013 - 08:23 PM, said:

I am using 1.1.10. I have the same question. Can someone shed some light?


http://www.yiiframew...265#entry171265
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