UI-Grid
noRecords
$("#grid").kendoGrid({
columns: [
...
],
dataSource: {
...
},
noRecords: true,
messages: {
noRecords: "There is no data on current page"
}
});
$("#grid").kendoGrid({
columns: [
...
],
dataSource: {
...
},
noRecords:{
template: "No data available on current page. Current page is: #=this.dataSource.page()#"
}
});
Auto Sizing
dataBound : function () {
var grid = $(".life-alpha-index").data("kendoGrid");
for (var i = 0; i < grid.columns.length; i++) {
grid.autoFitColumn(i);
}
}
var gridDataSource = new kendo.data.DataSource({...});
window.calculatePriceAggregate = function () {
var data = gridDataSource.data();
var total = 0;
for(var i = 0; i < data.length; i++) {
if (data[i].EligibleForDiscount === true) {
total += data[i].Price;
}
}
return total;
};
$("#grid").kendoGrid({
data: gridDataSource,
...
columns: [
{
field: 'Price',
footerTemplate: '#=window.calculatePriceAggregate()#'
}
]
});
{ field: "Price",
title: "Price",
footerTemplate: "Total Price: #= kendo.toString(sum, 'C') #"
}