2

I've inherited a project that uses Kendo, and I'm still learning its basics. A feature I'm working on entails getting JSON data from the server and using it to display something in a Web page. For this I'll use a dataSource, call its read function on the appropriate URL, and specify a callback to render the data; but I'm unsure whether to use view() or data() to get the JSON data from the dataSource. They appear to serve very similar purposes. Which one is appropriate if I'm using a simple callback to render data from the server, and what's the difference?

1 Answers1

8

Following Kendo UI documentation: The view() method returns only displayed data - after filtering, sorting, groupping and page selection. If you don't use any of this features or if you use it on the server side view() and data() will give you the same data.

In simple words view() returns displayed data and data() returns data available in dataSource (all data downloaded from service in the last read).

I'm working with Kendo for 2 years and I've almost always used the data() method for any type of action.

Jarosław Kończak
  • 3,387
  • 2
  • 19
  • 36