I'm having trouble figuring out how to create a REST API to service a Kendo UI Grid. Option #1 - use the REST API for paging, Option #2 - read the entire result set at once and have the Grid control handle the paging.
Here are the problems I've run into with both:
1) I pass the Page and PageSize parameters through the query string. The service get them, queries the data model, and returns just the number of records requested (e.g. 50 items from page 4). The problem is that the paging controls then shows *page size* for the number of items in the grid. That is, if my page size is 50 and there are 3,000 records in the result set, the Grid shows a total 50 with a displays a single "page" button on Page 1. How do you force the Kendo UI Grid to use the total number of records? How do you do this without running the query twice (once for the total, a second time to apply the Skip and Take values)?
2) I only have 3,000 records, so it's really no big deal to read the whole data set, but each time I hit the 'page forward', I get a spinner and the request for the entire data set goes out again. Is there any way to tell the Kendo Grid to suck down the entire set of 3,000 records, but locally page in chunks of, say, 50 items per page.
Here are the problems I've run into with both:
1) I pass the Page and PageSize parameters through the query string. The service get them, queries the data model, and returns just the number of records requested (e.g. 50 items from page 4). The problem is that the paging controls then shows *page size* for the number of items in the grid. That is, if my page size is 50 and there are 3,000 records in the result set, the Grid shows a total 50 with a displays a single "page" button on Page 1. How do you force the Kendo UI Grid to use the total number of records? How do you do this without running the query twice (once for the total, a second time to apply the Skip and Take values)?
2) I only have 3,000 records, so it's really no big deal to read the whole data set, but each time I hit the 'page forward', I get a spinner and the request for the entire data set goes out again. Is there any way to tell the Kendo Grid to suck down the entire set of 3,000 records, but locally page in chunks of, say, 50 items per page.