I have a kendoGrid
and i would like to get the JSON
out of it after filtering and sorting how do I achieve this?
something like the following,
var grid = $("#grid").data("kendoGrid");
alert(grid.dataSource.data.json); // I could dig through grid.dataSource.data and I see a function ( .json doen't exist I put it there so you know what i want to achieve )
Thanks any help is greatly appreciated!
To get count of all rows in grid
To get specific row items
To get all rows in grid
Json to all rows in grid
For the JSON part, there's a helper function to extract the data in JSON format that can help:
EDIT: after some errors with the above method due to kendo grid behavior, I found this article that solves the problem: Kendo DataSource view not always return observablearray
Something like this, to display only data that is being viewed at the moment. Also extended the grid to provide these functions all over the app.
If you want to get all pages of the filtered data you can use this:
Make sure to check if filters exist before trying to apply them or Kendo will complain.
I think you're looking for
Then stringify it as follows:
Hope this helps!