How to reload Grid?

3 Answers 7817 Views
Grid
agv
Top achievements
Rank 1
agv asked on 28 Nov 2011, 06:09 PM
I have added some text fields above my grid. I was wanting to attach a change event on these fields so that the grid reloads when the field are updated. I was wondering if there is a way to reload or re-initialize the grid?

3 Answers, 1 is accepted

Sort by
0
Accepted
Rosen
Telerik team
answered on 29 Nov 2011, 09:20 AM
Hello Agv,

In order to refresh the data to which grid is bound, you should call its dataSource read method:

$("#grid").data("kendoGrid").dataSource.read();

This will repopulate the dataSource data using the assign transport.

Regards,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
David
Top achievements
Rank 1
commented on 02 Dec 2011, 08:40 PM

This doesnt seem to be working 

$('#refresh').button().click(function(){
  //$('body').prepend('refresh called.<br/>');
  var l = gdata.length;
  gdata[gdata.length] = {ChainRing: l, MidDriveGear: l, MidDriveOutput: l, RearSprocket: l, GearRatio: l, Motive: l, GearInch: l, Speed: l };
  $("#grid").data("kendoGrid").dataSource.read();
     
 
  
Stanislav
Top achievements
Rank 1
commented on 24 Aug 2012, 05:53 AM

Hello! Reloading collapses all expanded subtrees and actually I dont know how to do it via current API. How to save grid state and extract it on reload?
0
agv
Top achievements
Rank 1
answered on 05 Dec 2011, 10:43 AM
$("#grid").data("kendoGrid").dataSource.sync();
0
Abhishek
Top achievements
Rank 1
answered on 23 Aug 2012, 04:55 AM
1- Try to disable the cache in Kendo grid's datasource read property.

'cache: false'

read: {
    dataType: "json",
    url: <<"url">>,
    cache: false
}

and then,

2- $("#grid").data("kendoGrid").dataSource.read();

It worked for me :)
Tags
Grid
Asked by
agv
Top achievements
Rank 1
Answers by
Rosen
Telerik team
agv
Top achievements
Rank 1
Abhishek
Top achievements
Rank 1
Share this question
or