GridView update with javascript..

I could use some help on GridView.I am refreshing the Gridview with javascript.I use ajax paging so I want to stay on the same page when I refresh,and not jump on the first.I found how to do this:For example if I am on page 4,this will update the grid and stay on page 4




$.fn.yiiGridView.update("product-grid", {url:"",data:{"Product_page":4} });



The problem is,how do I get the page number from a javascript variable??Is the page number stored somewhere in javascript?

I’m not sure if it’s stored anywhere. I see 2 possibilities:

  1. create your own variable to store current page number and update it in afterAjaxUpdate event.

  2. parse paginator html and look for an entry with an ‘active’ class

Thanks,number 2 will work, just found a child div of the pager div which stores the page number as text!

Cheers.

Please, post the solution.