Context Menu

This page shows how to use and configure right-click context menu with Handsontable:

Context Menu with default options

Tu run the basic configuration of the Context Menu, just set the contextMenu option to true.

From version 0.11, context menu also works for row and column headers. 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

Context Menu with specific options

You can limit options available in the context menu using contextMenu option as an array of strings:

  • row_above (designed for Context Menu)
  • row_below (designed for Context Menu)
  • hsep1
  • col_left (designed for both menus)
  • col_right (designed for both menus)
  • hsep2
  • remove_row (designed for Context Menu)
  • remove_col (designed for both menus)
  • hsep3
  • undo (designed for Context Menu)
  • redo (designed for Context Menu)
  • make_read_only (designed for both menus)
  • alignment (designed for both menus)
  • clear_column (designed for Dropdown Menu)
  • borders (only with Custom Borders turned on)
  • commentsAddEdit, commentsRemove (only with Comments turned on)
  • freeze_column, unfreeze_column (only with Column Freezing turned on)

Context Menu with with fully custom configuration

For greatest configurability, you use contextMenu option as a configuration object as described in jQuery contextMenu documentation.

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.