Kendo serverPaging using javascript and web API -
i have been having issues getting serverpaging option work on kendogrid. have searched several hours , can't seem work way expect to. here have:
api call:
[httpget] [route("getitemsbypage", name = "getitemsbypage"] public ienumerable<iitem> getbypage(int id, int page, int pagesize) { return foo.getbypage(id, page, pagesize); }
js:
var shareddatasource = new kendo.data.datasource({ transport: { read: { url: "localhost:2222/api/product/items/getbypage/?id=38&page=1&pagesize=100" datatype: "json" } }, schema: { total: // function return total // // rest of schema info // }, page: 1, pagesize: 100, serverpaging: true });
i have datasource attached grid div (all shows fine). server paging have issue with. can use api call items, , allow local paging, dont want data @ once.
you should setup transport.parametermap
option on datasource
var shareddatasource = new kendo.data.datasource({ transport: { read: { url: "localhost:2222/api/product/items/getbypage/?id=38&page=1&pagesize=100" datatype: "json" }, parametermap: function(data, type) { if (type == "read") { // send take "$top" , skip "$skip" return { pagesize: data.pagesize, page: data.page } } } }, page: 1, pagesize: 100, serverpaging: true });
i don't know id
in code. hope catch idea.
Comments
Post a Comment