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

Reset Grid to default when page loaded (sorting, filtering, paging, grouping etc...)

1 Answer 1867 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 21 Oct 2013, 08:49 PM
I would like to create a button that woudl allow the user to reset this grid.  Meaning that after they apply some sorting, grouping, paging etc... they can click on this button and it would return the grid to the state it was at when the page loaded... Similar to reloading the entire page, but just reloading the grid.

Thanks,
Jason

1 Answer, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 22 Oct 2013, 02:49 PM
Hello Jason,

What you can do in order to reset the grid is to call the read() method of the dataSource, so you can fetch the data again, and then call the respective methods for groups,sort, filter etc. with empty arguments:

$('#grid').data('kendoGrid').dataSource.sort({})
$('#grid').data('kendoGrid').dataSource.fitler({})

I would suggest you to take a look at the documentation articles, regarding the Kendo UI DataSource:

http://docs.kendoui.com/api/framework/datasource#methods
 
Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Jason
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or