CLinkPager update using Jquery

How do I update my CLinkPager using the onchange function of javascript? I have tried on using a dropdown list of showing 10, 20 and 50 pages. When I use that the pager then updates. But when I click on the pagers number for the next number, it goes back to the default page size. How can I prevent that from happening?

This is the way i update it. Isn’t there any $.fn.yiiGridview.update(data:{$(this).val()}) eauivalent in CLinkPager?

'onchange' => " new_pagination = $(this).val();

You need to maintain state of the page size in another way.

I haven’t shared my solution yet (behavior for behavior enabled CGridView (…

You can check:


Is there any way to pass a variable when clinkpager is clicked? or store a temporary variable in a method?


I attach my pager behavior to this post. [size=2]6453


The behavior changes the pagers links in order to include the size for each page.

So when you select another page size, the link is submitted and the page updated.

As you can see, the behavior is of medium complexity in order to cope with various cases, and above al, use the dynamic values from the system.

Kind regards