Hi All.
We have a source.
var dataSource = {TotalItemCount:10,data: [{"Name" : "Avocado","Status" : "exists"},
{"Name" : "Apple","Status" : "exists"},
{"Name" : "Orange","Status" : "exists"},
{"Name" : "Grape","Status" : "exists"},
{"Name" : "Grapefruit","Status" : "exists"},
{"Name" : "Pear","Status" : "exists"},
{"Name" : "Fig","Status" : "exists"},
{"Name" : "Melon","Status" : "exists"},
{"Name" : "Longan ","Status" : "exists"},
{"Name" : "Starfruit","Status" : "exists"}]}
<script>
$(document).ready(function () {
var grid_1;
grid_1 = $('#grid_1').kendoGrid({
dataSource:{
data: dataSource,
type: 'json',
pageSize:4,
serverPaging: true,
serverSorting: false,
schema: {
data: function(result) {
return result.data || result;
} ,
total: function(result) {
var data = this.data(result);
return result.TotalItemCount || result.length || 0;;
}
}
},
pageable: true,
columns: [{
field: 'Name',
title: 'Name',
},{
field: 'Status',
title: 'Status',
}]
}).data('kendoGrid');
});
</script>
Everything works fine if set "serverPaging: false". So, if you put " serverPaging: true "grid always displays all the data on page 1. Please help me solve this problem . Thanks for any help.
We have a source.
var dataSource = {TotalItemCount:10,data: [{"Name" : "Avocado","Status" : "exists"},
{"Name" : "Apple","Status" : "exists"},
{"Name" : "Orange","Status" : "exists"},
{"Name" : "Grape","Status" : "exists"},
{"Name" : "Grapefruit","Status" : "exists"},
{"Name" : "Pear","Status" : "exists"},
{"Name" : "Fig","Status" : "exists"},
{"Name" : "Melon","Status" : "exists"},
{"Name" : "Longan ","Status" : "exists"},
{"Name" : "Starfruit","Status" : "exists"}]}
<script>
$(document).ready(function () {
var grid_1;
grid_1 = $('#grid_1').kendoGrid({
dataSource:{
data: dataSource,
type: 'json',
pageSize:4,
serverPaging: true,
serverSorting: false,
schema: {
data: function(result) {
return result.data || result;
} ,
total: function(result) {
var data = this.data(result);
return result.TotalItemCount || result.length || 0;;
}
}
},
pageable: true,
columns: [{
field: 'Name',
title: 'Name',
},{
field: 'Status',
title: 'Status',
}]
}).data('kendoGrid');
});
</script>
Everything works fine if set "serverPaging: false". So, if you put " serverPaging: true "grid always displays all the data on page 1. Please help me solve this problem . Thanks for any help.