How to go to previous cell after pressing tab key?
You cannot focus()
the cell
because the cell
element is a div
, and it does not have the input
element rendered in it. You can use cell.edit()
to focus the input
element, but because the input
element needs time to render, you can wrap the edit()
call inside a setTimeout()
. So it would look like this:
setTimeout(function() {
cell.edit();
}, 100);
JSFiddle
Another way you can look into is to customize your own key bindings and disable the default action for the tab key. You can then perform your validation first, and then use navigateNext()
or navigateRight()
to move onto the next cell.