I'm using handsontable library and I got quite amazed when I found out there isn't an onEdit
callback.
I tried to create it by using the script provided by one user in that same issue but it seems its for an old version and it doesn't work anymore.
I tried to figure out how to add a hook, but the documentation on it is quite poor from handsontable. Does anybody know how to create such a callback for handsontable?
Capturing only double clicks is not enough, since a user may further enter edit-mode using the Enter or F1 keys.
One solution to the lack of
onEdit
callback is to register a custom editor. This way it fits nicely into all the edit-save-exit lifecycle (for example the the Esc key closes the editor and loses all changes). Here's a very simplified editor which extends the built-in and defaultTextEditor
:This solution, however, is not generic, since if there is more than one editor used, it will have to get replaced too. It should work in simple cases, though. The complete example can be found in this fiddle.