noRecords Boolean|Object
(default: false)
If set to true
and current view contains no records, message similar to "No records available" will be displayed. By default this option is disabled.
Example - enable noRecords message
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [
{ field: "name" },
{ field: "age" }
],
noRecords: true,
dataSource: []
});
</script>
noRecords.template String|Function
The template which is rendered when current view contains no records.
Example - customize the noRecords message
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [
{ field: "name" },
{ field: "age" }
],
pageable: true,
noRecords: {
template: () => `No data available on current page. Current page is: ${$("#grid").data("kendoGrid").dataSource.page()}`
},
dataSource: {
data: [{name: "John", age: 29}],
page: 2,
pageSize: 10
}
});
</script>
Example - specify noRecords message as a function
<div id="grid"></div>
<script>
$("#grid").kendoGrid({
columns: [
{ field: "name" },
{ field: "age" }
],
pageable: true,
noRecords: {
template: function(e){
var page = $("#grid").getKendoGrid().dataSource.page();
return "No data available on current page. Current page is: " + page;
}
},
dataSource: {
data: [{name: "John", age: 29}],
page: 2,
pageSize: 10
}
});
</script>