Handsontable provides some nice hooks for when a cell is selected but I can\'t seem to figure out way to get it to allow me to force a cell into edit mode when it has been s
And I believe I've answered my own question:
Handsontable.PluginHooks.add( 'afterSelectionEnd', function() {
f2_event = $.Event( 'keydown', { keyCode: 113 } );
this.$table.trigger(f2_event);
});
That seems to do the trick.
For anyone intersted in this question, now there is a better programmable way to achieve the same result.
this.selectCell(row, col);
this.getActiveEditor().beginEditing();
This selects the (row, col)
cell and enters edit mode (i.e. same as double click or pressing F2/Enter).
Edit Mode on click:
afterSelectionEnd: function (r, c, r2, c2) {
if (r == r2 && c == c2) {
getActiveEditor().beginEditing();
getActiveEditor().enableFullEditMode();
}
}
When you add enableFullEditMode(); caret moves in the cell while pressing left or right button instead of jump to another cell.
Anaother example: only first row:
afterSelectionEnd: function (r, c, r2, c2) {
if (r == r2 && c == c2) {
if (r == 0 && r2 == 0) {
getActiveEditor().beginEditing();
getActiveEditor().enableFullEditMode();
}
}
}