Grid Settings vs. DataSource Settings

3 posts, 1 answers
  1. Bilal
    Bilal avatar
    109 posts
    Member since:
    Oct 2014

    Posted 30 Oct 2014 Link to this post

    I am newly learning Kendo UI. I realized that the DataSource plays the role of reading, creating, updating, and deleting of data. So far, I noticed that it's being used only with Grid to do so. For instance, if I have an HTML form, can I still use DataSource to carry on CRUD operations? For example, when user submits a form, can I ask DataSource to create new record, or update existing, or delete existing by calling functions on DS?

    Some of the settings set on DataSource like paging, sortable, grouping, etc. Also, Grid has similar such settings. Is it necessary to add those settings on both Grid and DataSource? I am kind of mixed up here.

    Thank you & regards
  2. Bilal
    Bilal avatar
    109 posts
    Member since:
    Oct 2014

    Posted 30 Oct 2014 in reply to Bilal Link to this post

    I wanted to edit my post, but didn't find how, so I had to reply to it.

    Even going through the documentation, in one case, the code it setting a custom editor for the Grid column specifying it's required, also it sets the required on DataSource. Why have both?

  3. Answer
    Petur Subev
    Petur Subev avatar
    1882 posts

    Posted 03 Nov 2014 Link to this post

    Hello Bilal,

    You can use the dataSource separately from the Grid however keep in mind that the DataSource is responsible for managing a collection of items, not just a single item. Here is a demo that uses DataSource:

    The settings of the DataSource specify at what level the different operations such as sorting, filtering etc are performed - they could be on the server (implemented by the developer manually) or on the client (built into the framework

    While on the other hand the Grid has settings which specify whether the sorting is enabled on the Grid at all. For example you can have two Grids wired to one dataSource (or other widgets) and one of the Grids allows sorting and the other one does not.

    As explained in the highlighted text the developer is responsible to add the corresponding required attribute since he customizes the input and takes full control how the editor is rendered.

    Kind Regards,
    Petur Subev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top