The kendoPager is a beautiful widget that typically allows the user to navigate through a Kendo grid. It has fast forward and forward buttons to go to the first item and the previous item, displays the current page, which you can click to select another page, and forward and fast forward buttons to select the next and the last grid page. It is an intuitive control that is adaptive and themable.

Although there is no official documentation on this, we can also use this control in any page. You're not limited to only using this in the grid!

I'll show you my approach. You can see this Kendo pager in action by scrolling to the very bottom of this page below.

First create an element for the pager.
2) Create the datasource. Provide the URL in the pagerUrl element, and the page number.
3) Instantiate the pager control, and provide a change method. We will pass the complete datasource to the change method that we will invoke next.
4) Read the datasource to populate the kendoPager control.
5) Invoke the onPagerChange method, extract the values from the passed datasource, and redirect the user using javascript.

Here is the code:

view plain about
1<div id="pager" data-role="pager" class="k-pager-wrap k-widget k-floatwrap k-pager-lg">
2&lt;script>

3    // Create the datasource with the URL and page number.
4    var pagerDataSource = new kendo.data.DataSource({
5        data: [
6            { pagerUrl: "&startRow=0&page=1", page: "1" },
7            { pagerUrl: "&startRow=10&page=2", page: "2" },
8            { pagerUrl: "&startRow=20&page=3", page: "3" },
9            { pagerUrl: "&startRow=30&page=4", page: "4" }
10        ],
11        pageSize: 1,// Leave this at 1.
12        page: 4 // Specify the currently selected page using a server side language.
13    });
14
15    var pager = $("#pager").kendoPager({
16        dataSource: pagerDataSource,
17        // Pass the datasource to an onChange method outside of this function.
18        change: function() {
19            onPagerChange(this.dataSource.data());
20        }
21    }).data("kendoPager");
22    
23    // Read the datasource.
24    pagerDataSource.read();
25
26    // Extract passed data from the datasource and redirect the user.
27    function onPagerChange(data){
28        // Get the current page of the pager. The method to extract the current page is 'page()'.
29        var currentPage = pager.page();
30        // We are going to get the data item held in the datasource using its zero index array, but first we need to subtract 1 from the page value.
31        var index = currentPage-1;
32        // Get the url that is stored in the datsource using our new index.
33        var pagerUrl = "?" + data[index].pagerUrl;
34        // Open the page.
35        window.location.href = pagerUrl;
36    }
37&lt;/script>
38 </div>