totalPages

Returns the number of pages.

Example - get the total number of pages

<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.totalPages()); // displays "2"
</script>
<style>
  #pager {
   margin-top: 100px;
  }
</style>

Returns

Number The number of pages.

In this article