Hi,
For some reasons, I attach several grids to the same layout cell for several times.
var mylayout; // pattern 1C
var gridA, gridB;
reload_grid(gridA); // normal
reload_grid(gridB); // normal
reload_grid(gridA); // from here, problem arises, because gridA currently is invisible, but .getSelectedRowId() is executed
function reload_grid(mygrid){
if(mygrid){
var sels = mygrid.getSelectedRowId(); // If mygrid is not visible, infinite loops
}
mygrid = mylayout.cells("a").attachGrid();
}
I changed the code like below, then the code was executed successfully.
function reload_grid(mygrid){
if(mygrid && mygrid.isVisible){ // here is the trick
var sels = mygrid.getSelectedRowId(); // If mygrid is not visible, infinite loops
}
mygrid = mylayout.cells("a").attachGrid();
}