Reputation: 6111
I'm trying to implement server-side paging on a listView, but it only ever renders the first page. I've done some debugging and what I've found is that in my pager's change event it never called read on the dataSource so I decided to call it manually like this:
App.photoLineupPager = $("#photo-lineup-pager").kendoPager({
"dataSource": $("#photo-lineup").data("kendoListView").dataSource,
"change": function (e) {
e.preventDefault();
$("#photo-lineup").data("kendoListView").dataSource.read();
}
}).data("kendoPager");
It now hits the endpoint, returns the expected data, and the loading icon appears where the listView would be. However, the listView isn't displaying any data and in my console if I call:
$("#photo-lineup").data("kendoListView").dataSource.data()
It has values in the returned object, but if I call:
$("#photo-lineup").data("kendoListView").dataSource.view()
There aren't any values in the returned object. And I believe this is why my listView isn't rendering anything past the first page. So I have a couple of questions:
Update So it was literally just a matter of setting the serverPaging property on the dataSource to true. Once I specified that I no longer needed to call the read event in my pager's change event too.
Upvotes: 0
Views: 1189