Custom Context Menu
From Documentation
Overview
This section describes how to pop up a new customized context menu in a Spreadsheet. The steps are simple
- Disable built-in context menu
- Create your own context menu
- Show custom context menu
We should hide built-in context menu in order to show our customized one only.
Extracted from customContext.zul
<spreadsheet id="ss" width="100%" height="100%" showFormulabar="true"
showContextMenu="false" showToolbar="true" showSheetbar="true" maxVisibleRows="100"
maxVisibleColumns="20" src="/WEB-INF/books/blank.xlsx" />
- Line 2: Specify showContextMenu="false" to hide built-in context menu.
Menupopup is the most suitable component to build a context menu.
Extracted from customContext.zul
<menupopup id="myContext">
<menuitem id="display" label="Display Information" />
<menuitem id="open" label="Open Dialog" />
</menupopup>