Browsing the grid using arrow keys / Enter key edit-loose focus
Hey guys!
Was pretty impress about this nifty widget! I need to use it in one of my applications. What I want to do is:
1. use the arrow keys to navigate the grid
2. use Enter key to change the content of a cell
3. use Enter key again to "confirm" the content of edited cell
4. use Enter key to move to first cell in the right of current cell
The 2 and 3 list items described above are done [I mean, I managed to make it work]. I need some help with 1 and 4 items. Can you help?
Here is the way I get to... but did not move forward for a couple of hours, as I'm stuck:
Was pretty impress about this nifty widget! I need to use it in one of my applications. What I want to do is:
1. use the arrow keys to navigate the grid
2. use Enter key to change the content of a cell
3. use Enter key again to "confirm" the content of edited cell
4. use Enter key to move to first cell in the right of current cell
The 2 and 3 list items described above are done [I mean, I managed to make it work]. I need some help with 1 and 4 items. Can you help?
Here is the way I get to... but did not move forward for a couple of hours, as I'm stuck:
// trying to handle the ENTER key and ARROW keys
var defaultEventHandler = obj.getEvent("onkeydown");
obj.setEvent("onkeydown", function(e){
if(event.keyCode==13){ // enter key
// need to move to the next right cell
}
else if(event.keyCode==37){ // left key
// move the selection to the left 1 cell
}
else if(event.keyCode==39){ // right key
// move the selection to the right 1 cell
}
else if(event.keyCode==38){ // up key
// move the selection up 1 cell
}
else if(event.keyCode==40){ // down key
// move the selection down 1 cell
}
else{
defaultEventHandler.call(this, event);
event.returnValue = false;
}
} );
Stefan [RO]
October 27,