Hi. I want to make ‘if … else’ sentence in onEditCell.
If keydown arrow keys, return false to onEditCell and if keydown abc…(normal keys), return true to onEditCell.
I know ‘return false’ makes this function do move cell position without edit cell. I want to make this like excel. So if type something text, then start to edit mode.
myGrid.attachEvent('onEditCell', function (stage, rId, cInd, nValue, oValue) {
return false;
}
I tried this but return false access not onEditCell function but onkeydown function.
myGrid.attachEvent('onEditCell', function (stage, rId, cInd, nValue, oValue) {
if (stage == 0) {
document.onkeydown = function (e) {
e = e || window.event;
if (e.which || e.keyCode == 37, 38, 39, 40) { //arrow up,down,left,right keys
return false;
}
else //other keys
{
return true;
}
}
}