Docs

Documentation versions (currently viewingVaadin 8)

Vaadin 8 reached End of Life on February 21, 2022. Discover how to make your Vaadin 8 app futureproof →

Context Menus

Grid has a context menu, which can be used for various editing functions. The context menu uses the standard Vaadin action handler mechanism.

Default Context Menu

The SpreadsheetDefaultActionHandler provides a ready set of common spreadsheet editing operations.

  • Add, delete, hide, and show rows and columns

  • Insert, edit, and delete cell comments

  • Merge and unmerge cells

  • Add filter table to selected range

The default context menu is not enabled by default; to enable it, you need to create and set it as the action handler explicitly.

sheet.addActionHandler(new SpreadsheetDefaultActionHandler());

Custom Context Menus

You can implement custom context menus either by implementing an ActionHandler or extending the SpreadsheetDefaultActionHandler. The source code of the default handler should serve as a good example of implementing context menu items for different purposes.