|
@{ List<object> toolbarItems = new List<object>();
toolbarItems.Add(new { template = "<div><input type='checkbox' id='check' checked=''>Accept</input></div>" , id = "check" });
. . . } @Html.EJS().Grid("Grid").DataSource((IEnumerable<object>)ViewBag.dataSource).Columns(col =>
{ col.Field("OrderID").HeaderText("Order ID").IsPrimaryKey(true).Width("120"). Add();
col.Field("ShipName").HeaderText("Ship Name").Width("150").Add();
}).AllowGrouping().Height("300").ToolbarClick("toolbarClick").Toolbar(toolbarItems).Render()
<script> function toolbarClick(args) {
if (args.item.id === "check") {
alert("Custom toolar template")
} } </script> |
|
var gridObj = document.getElementById('Grid').ej2_instances[0]; var total = gridObj.pageSettings.totalRecordsCount; // To get total records count
var currentPage = gridObj.pageSettings.currentPage;// To get the current page values |