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

Update Grid from search

1 Answer 139 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 12 Jun 2012, 02:12 PM
Hello,

I am using a Grid to populate an employee directory.  A user can then search by typing into a text box.  The search criteria is being handled by a service call.  The problem is updating the grid with the new data set.  I have found how to put the current grid into a variable, but I have not been able to reset the data source and refresh the grid

var grid = $("#grid").data("kendoGrid");

Thanks



1 Answer, 1 is accepted

Sort by
0
Nohinn
Top achievements
Rank 1
answered on 12 Jun 2012, 03:15 PM

Though the grid has it's own filter control, if you want to refresh the dataSource after searching for something you will have to set again the possible dataSource parameters and call it's read method.

var grid = $('#grid').data('kendoGrid');
// if you need to change any parameter sent to the read method
grid.dataSource.transport.options.read.data.vartochange = newvalue;
//
grid.dataSource.read();

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