How to insert multiple rows at a time using context menu option and fire before and after create hooks for customisation
Inserting multiple rows
To create a custom option for adding rows you can use the alter()
method and the object-way of creating a context menu.
Here https://jsfiddle.net/xj2fb9L7/ we
- create
contextMenu
as an object withitems
- we use some predefined keys (that you can find here https://handsontable.com/docs/context-menu/#context-menu-with-fully-custom-configuration)
- we add a new option to add 5 rows below the selected row using the
callback
selection
parameter