Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
150
Get # of selected page on client side
posted

Hi everyone,

I'm trying to get on client side (javascript function) the number of the page that the user selected on the grid.

I create the Paging Client Side Event and this javascript function has only a sender parameter but I can't find how to get which #page the user press to move. I need this because I need to move another grid to another page too.

Thanks a lot !!!

Gustavo.-

Parents
No Data
Reply
  • 18204
    Verified Answer
    Offline posted

    Hello Gustavo,

     

    Thank you for posting in our forums!

    As you mention there is only a sender argument, I am assuming you are handling the PageIndexChanged event.  The sender argument is the grid, which means you can access the Paging behavior from it.  Also, since this is the PageIndexChangED event, the Paging behavior is storing the new page index.

    You can use the following code to get the page index:

    var newPageIndex = sender.get_behaviors().get_paging().get_pageIndex();

    Or if you happen to be handling the PageIndexChangING event, there should be a second argument, eventArgs.  If you are using the PageIndexChanging event and do not see the eventArgs parameter, you can add eventArgs to the signature.  And you can use the following code to get the new page index:

    var newPageIndex = eventArgs.get_newPageIndex();

    If you have any further questions or concerns with this, please let me know.

Children