page
Gets or sets the current page.
Example - get current page
<div id="pager"></div>
<script>
var dataSource = new kendo.data.DataSource({
data: [
{ productName: "Tea", category: "Beverages" },
{ productName: "Coffee", category: "Beverages" },
{ productName: "Ham", category: "Food" },
{ productName: "Bread", category: "Food" }
],
pageSize: 2
});
dataSource.read();
var pager = $("#pager").kendoPager({
dataSource: dataSource
}).data("kendoPager");
/* The result can be observed in the DevTools(F12) console of the browser. */
console.log(pager.page()); // displays "1"
</script>
<style>
#pager {
margin-top: 100px;
}
</style>
Example - set current page
<div id="pager"></div>
<script>
var dataSource = new kendo.data.DataSource({
data: [
{ productName: "Tea", category: "Beverages" },
{ productName: "Coffee", category: "Beverages" },
{ productName: "Ham", category: "Food" },
{ productName: "Bread", category: "Food" }
],
pageSize: 2
});
dataSource.read();
var pager = $("#pager").kendoPager({
dataSource: dataSource
}).data("kendoPager");
pager.page(2);
</script>
<style>
#pager {
margin-top: 100px;
}
</style>
Parameters
page Number
The new page number.
Returns
Number
The current page number.