Hi there,
I am currently editing my grid not using the Kendo editor. I send the grid cell to my editor and refresh the grid after edition is complete.
What I am trying to do is to keep the edited line highlighted using dataBound(). But because of the asynchronous load of data, the dataBound function is executed before my grid is fully loaded.
Here is the used code, I really cannot figure out why the dataBound function is executed before data are loaded.
Am I doing something wrong ??
I am currently editing my grid not using the Kendo editor. I send the grid cell to my editor and refresh the grid after edition is complete.
What I am trying to do is to keep the edited line highlighted using dataBound(). But because of the asynchronous load of data, the dataBound function is executed before my grid is fully loaded.
Here is the used code, I really cannot figure out why the dataBound function is executed before data are loaded.
var
kendoDefaultParams = {
// removed for clarity
dataBound: onDataBound,
// removed for clarity
};
$(
"#grid"
).kendoGrid(kendoDefaultParams);
function
onDataBound() {
gva.reSelectElements();
};
reSelectElements =
function
() {
// gva.selectedVms() contains the previous selected elements
if
(gva.selectedVms().length == 0 || gva.selectedVms() ==
null
|| gva.selectedVms() == undefined) {
return
; }
var
id = gva.selectedVms()[0].uid;
var
grid = $(
"#grid"
).data(
"kendoGrid"
);
var
row = grid.table.find(
"tr[data-uid=\""
+ id +
"\"]"
);
grid.select(row);
};
Am I doing something wrong ??