Here is the HTML Design and JQuery code to get total number of records in Kendo Grid:
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Untitled</title>
-
- <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2015.3.930/styles/kendo.common.min.css">
- <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2015.3.930/styles/kendo.rtl.min.css">
- <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2015.3.930/styles/kendo.default.min.css">
- <link rel="stylesheet" href="http://kendo.cdn.telerik.com/2015.3.930/styles/kendo.mobile.all.min.css">
-
- <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
- <script src="http://kendo.cdn.telerik.com/2015.3.930/js/angular.min.js"></script>
- <script src="http://kendo.cdn.telerik.com/2015.3.930/js/jszip.min.js"></script>
- <script src="http://kendo.cdn.telerik.com/2015.3.930/js/kendo.all.min.js"></script>
- </head>
- <body>
- <div id="grid"></div>
- <script>
- $(document).ready(function () {
-
-
- $("#grid").kendoGrid({
- selectable: "multiple cell",
- allowCopy: true,
- dataBound: onDataBound,
- columns: [
- { field: "productName" },
- { field: "category" }
- ],
- dataSource: [
- { productName: "Tea", category: "Beverages" },
- { productName: "Coffee", category: "Beverages" },
- { productName: "Ham", category: "Food" },
- { productName: "Bread", category: "Food" }
- ]
- });
-
- })
- function onDataBound(e) {
- e.preventDefault();
- alert(this.dataSource.total());
- }
- </script>
- </body>
- </html>