Hi I am working with the Kendo UI grid and am currently able to display data from my MySQL database using JSON to transport the information.
I am allowing the user to update the data in the database through a series of inputs, which when clicking a row on the grid are populated by an item in the grid's datasource. This is all working perfectly and very quickly. However, when I update the item I am then calling the .read() method on the datasource, and the only issue I am having is that I am not currently able to figure out how I can reselect the same row. I can loop through the datasource's views and find the view in particular that matches up to the edited item by one of its properties but I can't figure out a way to reselect it.
var grid = $(".grid.dynamic.tbl").data("kendoGrid");
grid.dataSource.read();
//console.log(grid.dataSource.view());
for (i in grid.dataSource.view()){
console.log(grid.dataSource.view()[i]);
if (myID == grid.dataSource.view()[i].MyID) console.log('Found correct ID at index: '+i);
}
Any ideas? It is probably staring me right in the face to be honest.
I am allowing the user to update the data in the database through a series of inputs, which when clicking a row on the grid are populated by an item in the grid's datasource. This is all working perfectly and very quickly. However, when I update the item I am then calling the .read() method on the datasource, and the only issue I am having is that I am not currently able to figure out how I can reselect the same row. I can loop through the datasource's views and find the view in particular that matches up to the edited item by one of its properties but I can't figure out a way to reselect it.
var grid = $(".grid.dynamic.tbl").data("kendoGrid");
grid.dataSource.read();
//console.log(grid.dataSource.view());
for (i in grid.dataSource.view()){
console.log(grid.dataSource.view()[i]);
if (myID == grid.dataSource.view()[i].MyID) console.log('Found correct ID at index: '+i);
}
Any ideas? It is probably staring me right in the face to be honest.