This is a migrated thread and some comments may be shown as answers.

Clear Kendo Grid rows/content

1 Answer 2917 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Balwant
Top achievements
Rank 1
Balwant asked on 11 Mar 2013, 06:47 PM
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

1 Answer, 1 is accepted

Sort by
2
Balwant
Top achievements
Rank 1
answered on 11 Mar 2013, 08:53 PM
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
GORAN
Top achievements
Rank 1
Iron
commented on 11 May 2023, 02:07 PM

Thanks for posting the solution. that worked for me too.

 

Anton Mironov
Telerik team
commented on 15 May 2023, 06:55 AM

Hi Goran,

If further assistance or information is needed - let us know.

 

Kind Regards,
Anton Mironov

Tags
Grid
Asked by
Balwant
Top achievements
Rank 1
Answers by
Balwant
Top achievements
Rank 1
Share this question
or