I have hooked up a datasouce (with serverPaging: true) to both a listview and a pager.
The server returns the correct number of records (and an int indicating the total number of records) from the initial db query, however the pager's navigation buttons are disabled, as if the pager doesn't recognise the datasource.schema.total.
Is the combination datasource with serverPaging:true, listview and pager possible?
var ds = new window.kendo.data.DataSource({
transport: {
read: {
type: "POST",
url: url,
data: function () {
return {
country: 1
};
},
dataType: "json",
contentType: "application/json; charset=utf-8"
},
parameterMap: function (data) {
return JSON.stringify(data);
}
},
serverPaging: true,
schema: {
model: {
id: "id",
fields: {
id: { type: "number" },
field1: { type: "string" },
field2: { type: "string" }
}
},
total: 'total'
},
pageSize: 50
});
$("#list").kendoListView({
dataSource: ds,
template: window.kendo.template($("#tmpl").html())
});
$("#pictures-pager").kendoPager({
dataSource: ds,
numeric: false,
refresh: true,
messages: {
display: "{0}-{1} / {2}",
empty: "",
itemsPerPage: ""
},
pageSizes: [10, 50, "all"]
});