I have a grid that's going to be used primarily by someone with a barcode scanner. The first column of the grid is going to be where the barcode is entered. The way these (and many) barcode scanners work is that it acts like a keyboard and emulates keypresses and ends with emulating the ENTER key.
In the case where the ENTER key is pressed to end editing (as opposed to mouse clicking elsewhere or tabbing or whatever), I want to insert a new empty row into the grid and set the grid to edit the barcode cell in that new row.
I do not want other methods of ending the cell edit (tab, mouse click, whatever) to do this. I only want it for the ENTER key.
My current way of handing this was to grab the igEditor when in the editCellStarted event and then binding to the keypress event in the igEditor to test keycodes. I get all the keycodes until the ENTER key, at which point I get the editCellEnded event but no keycode to tell me if the ENTER key is what ended it.
How can I fulfill these requirements?
Thanks.
Thank you Todor! That works. I was doing Keypress which I supposed is probably handled by the editor and not passed on since it ends editing. But it makes sense the Keydown would get passed through. I should have thought of that. Thanks a lot.
Hi Pete Davis,
On which event of the igEditor you are hooking? If you try 'keydown' you should be able to get the keyCode of the Enter which is 13, as far as I remember.
Thanks,