Clear Kendo Grid rows/content

2 posts, 0 answers
  1. Balwant
    Balwant avatar
    4 posts
    Member since:
    Oct 2012

    Posted 11 Mar 2013 Link to this post

    Hi,

    This must be something already discussed, but I couldn't find a solution.

    We need to implement a Reset button on the view with KendoGrid, which needs to clear/empty the grid (datasource). It's only clearing the UI element, but not deleting the record.

    Tried jquery empty(), but doesn't look like its supported. That may be the option to use, but couldn't find any so far...

    $("#gridId").data("kendoGrid").dataSource.empty();

    Want to see if anyone had such scenario and have had any luck implementing the functionality?

    Input on any appropriate approach is much appreciated.

    Thanks,
    Balwant
  2. Balwant
    Balwant avatar
    4 posts
    Member since:
    Oct 2012

    Posted 11 Mar 2013 Link to this post

    I found the solution and thought would share it, to be helpful for others looking...

    Here's the thread I got the suggestion from,

    http://www.kendoui.com/forums/framework/data-source/how-to-clear-a-datasource-used-in-mvvm.aspx

    As said in above thread, i tried passing an empty array to the datasource which worked as expected.

    $("#gridId").data("kendoGrid").dataSource.data([ ]);

    Thanks,
    Balwant
Back to Top