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

Binding grid row change to 2nd Grid

1 Answer 68 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 02 Dec 2011, 11:05 PM
I've got a 3 areas on my page: a main grid, a form, and a tabbed area with many grids. When the main grid row changes, I fire off 2 functions. The first function "getRole" populates the form, the 2nd function "populateGrids" updates the grids in the tabs. The tabbed grids are binding fine, but instead of the data refreshing, the new data is added to the old recordset. Refresh() and read() do not work in this case. Is there a way to destroy the grids prior to running "populateGrids"? Code below. Thanks for the assistance - love the framework. 

$("#mygrid").kendoGrid({
columns:[ my columns ],
dataSource: {
data: [ my data ]
},
change: function(r) {
var key = this.dataSource.view()[this.select().index()];
       getRole(key.roleID);
populateGrids(key.roleID);
   }
 });

1 Answer, 1 is accepted

Sort by
0
Chris
Top achievements
Rank 1
answered on 03 Dec 2011, 06:20 PM
I solved this by inserting the following function prior to my kendogrid function:

$("#mygrid").empty();

$("#mygrid").kendoGrid({
columns:[ my columns ],
dataSource: {
data: [ my data ]
},
change: function(r) {
var key = this.dataSource.view()[this.select().index()];
        getRole(key.roleID);
populateGrids(key.roleID);
    }
  });
Tags
Grid
Asked by
Chris
Top achievements
Rank 1
Answers by
Chris
Top achievements
Rank 1
Share this question
or