I would like to know to switch current edited cell in a row?
Example:
On “onEditCell” on 2 cell switch editor to cell 1 edit when cell 1 is empty (cell 1 value is necessary for cell 2 editor).
I try this approach:
grid.attachEvent(“onEditCell”, function(stage,rowId,cIndex,nValue,oValue){
if(stage==0 && cIndex==1){
var ODD = grid.cellById(rowId,0).getValue();
if(ODD==’’) {
alert(“Fill cell 1 first!”);
grid.selectCell(grid.getRowIndex(rowId), 0, true, false, true, true);
return false;
}
}
}
Please try to change you code like that:
grid.attachEvent(“onEditCell”, function(stage,rowId,cIndex,nValue,oValue){
if(stage==0 && cIndex==1){
var ODD = grid.cellById(rowId,0).getValue();
if(ODD==’’) {
alert(“Fill cell 1 first!”);
window.setTimeout(function(){
grid.selectCell(grid.getRowIndex(rowId), 0, true, false, true, true);
},1);
return false;
}
else return true;
}
}