Handsontable - Context Menu
The following example demonstrates a basic setup of content menu. To run the basic configuration, just set the contextMenu
option to true
. When the context menu for the row header is opened, the column options are disabled. Likewise, when the context menu for the column header is opened, the row options are disabled.
You can limit options available in the context menu using contextMenu
option as an array of strings: row_above
- insert row above; row_below
- insert row below; col_left
- insert column on the left; col_right
- insert column on the right; remove_row
- remove row; remove_col
- remove column; undo
- undo action; redo
- redo action; make_read_only
- read only; alignment
- submenu with alignment options. For separator use '---------'
string.
The following example demonstrates custom context menu configuration. For greatest configurability, you use contextMenu
option as a configuration object as described in jQuery contextMenu documentation siddim.com. This example shows how to set custom text, how to disable "Remove row" and "Insert row above" for the first row and how to add your own option.
Copy and Paste feature are available in Handsontable by default, but only as key shortcuts (Ctrl (Cmd) + C and Ctrl (Cmd) + V respectively). This plugin makes them available also as a clickable options in the context menu. Unfortunately, due to the browser's security restrictions, Handsontable is forced to use a third-party flash-based Zero Clipboard library - it adds a small invisible flash clip to your website, allowing the user to click on it, and thus save data to the clipboard.