This is a migrated thread and some comments may be shown as answers.

[Solved] Custom Paging

4 Answers 59 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Ryan
Top achievements
Rank 1
Ryan asked on 16 Mar 2010, 06:04 AM
I would like an additional pager to the grid - not necessarily located next to the grid.

In particular I would like to add an additional next and previous button to the page. Are there any methods on the Grid  that I can call to move to the next/previous page when using ajax paging?

4 Answers, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 16 Mar 2010, 09:12 AM
Hello Ryan,

You have two options - either to delegate clicks to the grid or to use the client-side API. Delegating clicks is really short and (in my opinion) easier to maintain, so here it is:

    // previous
    $("#YourPrevButton")
        .click(function(e) {
            e.preventDefault();

            $("#GridName .t-pager .t-arrow-prev").trigger("click"); // delegate click
        });

    // next
    $("#YourNextButton")
        .click(function(e) {
            e.preventDefault();
            $("#GridName .t-pager .t-arrow-next").trigger("click"); // delegate click
        });


Greetings,
Alex Gyoshev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Ryan
Top achievements
Rank 1
answered on 16 Mar 2010, 09:22 AM
Hi Alex,

thanks for the reply,

I am interested in using the client api as well, can you tell me what method i could use.
The docs mention 
grid.dataBind(data);
grid.ajaxRequest();
grid.rebind();
however i'm unsure which one would achieve the paging function

thanks

Ryan
0
Accepted
Alex Gyoshev
Telerik team
answered on 16 Mar 2010, 09:30 AM
Hello Ryan,

Sure!

grid.pageTo(pageNumber);

Greetings,
Alex Gyoshev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Ryan
Top achievements
Rank 1
answered on 16 Mar 2010, 09:31 AM
Awesome!! 

Thanks :-)
Tags
Grid
Asked by
Ryan
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Ryan
Top achievements
Rank 1
Share this question
or