The behavior I’m trying to effect on validation of a single cell is that if the value entered into a particular cell is invalid I want to maintain the focus on that cell. If a user inputs a bad value then clicks on another editable cell then the grid maintains the focus on the new cell and not the one with the previously entered bad value. I can’t think of a way to maintain the focus on the bad cell. Here’s a way that I thought might work, but it doesn’t. How can I get this behavior from the grid? I’m using the professional edition.
myGrid.attachEvent(“onEditCell”,validateCell);
.
.
.
function validateCell (stage,rowId,columnIndex,newValue,oldValue) {
if (stage==2) {
badRowId = rowId;
badColumnIndex = columnIndex;
return false;
} else if (stage == 1) {
if (badRowId != undefined) {
myGrid.selectCell(badRowId,badColumnIndex,true,true);
return false;
}
}
}
In this simple test I thought I’d be able to set focus back to the bad cell but this doesn’t work. Focus is given to the other cell that was clicked. Thank you for your help.