I am using Knockout-Kendo.js library for my js + HTML5 SPA. In my viewmodel I have a myItems
Knockout Observable Array. I have a client-side repository that is responsible for getting data from server and keeping it. I want to be able to fill myItems
in my viewmodel based on a POST request to an API that sends a filter object (containing filters and paging info) to server and returns a list of filtered items.
- As much as I know the Knockout-Kendo doesn't support Kendo Grid DataSource. I should set the source via its
data
property instesd ofdataSource
. Am I right? If yes, can I achieve the requirements in the question below? - How can I set grid's options so that I set the total number of results, page number, top, skip, etc. for server paging? (I should be able to set my filter object in viewmodel based on the clicked page number of Kendo Grid for example, and send it with my POST request to server.)
- Also, to be able to get the total number of items for paging, should I receive JSON data from server in a format like this:
{total: 675, data: {some JSON array containing items for the current page}}
or there are alternatives to achieve this?