How to reload or refresh a Kendo Grid using Javascript?
It is often required to reload or refresh a grid after sometime or after a user action.
How to reload or refresh a Kendo Grid using Javascript?
It is often required to reload or refresh a grid after sometime or after a user action.
You can always use
$('#GridName').data('kendoGrid').dataSource.read();
. You don't really need to.refresh();
after that,.dataSource.read();
will do the trick.Now if you want to refresh your grid in a more angular way, you can do:
OR
And don't forget to declare your datasource as
kendo.data.DataSource
typeIn my case I had a custom url to go to each time; though the schema of the result would remain the same.
I used the following:
Actually, they are different:
$('#GridName').data('kendoGrid').dataSource.read()
refreshes theuid
attributes of the table row$('#GridName').data('kendoGrid').refresh()
leaves the same uidI never do refresh .
alone works for me all the time.
If you do not want to have a reference to the grid in the handler, you can use this code:
This will refresh the grid, if there is a refresh button. The button can be enabled like so:
By using following code it automatically called grid's read method and again fill grid