PopupMenuType Enum
In This Article
Lists values that identify the context menu type.
#Declaration
TypeScript
enum PopupMenuType {
ColumnHeading,
RowHeading,
SheetTab,
Picture,
Chart,
Cell,
AutoFilter,
PivotTable,
PivotTableAutoFilter
}
#Members
Name | Description |
---|---|
Auto
|
Specifies a context menu for the Auto |
Cell
|
Specifies a context menu for a cell in a worksheet. |
Chart
|
Specifies a context menu for a chart in a worksheet. |
Column
|
Specifies a context menu for a column header. |
Picture
|
Specifies a context menu for a picture embedded in a worksheet. |
Pivot
|
Specifies a context menu for a cell in a pivot table. |
Pivot
|
Specifies a context menu for the Auto |
Row
|
Specifies a context menu for a row header. |
Sheet
|
Specifies a context menu for a worksheet tab. |
#Remarks
The values listed by this enumerator are used to set the menuType property’s value.
#Example
For a full example, see Spreadsheet - Context Menu Customization demo.
function SpreadsheetPopupMenuShowing(s, e) {
if (e.menuType === PopupMenuType.Cell) {
e.menuItems.Clear();
if (needToAddCustomMenuItems(s)) {
if (isSelectedCellOfType(s, currencyColumns))
addCustomMenuItem(e.menuItems, convertCurrencyCommand);
if (isSelectedCellOfType(s, discountColumns))
addCustomMenuItem(e.menuItems, discountCommand);
if (isSelectedCellOfType(s, weightColumns))
addCustomMenuItem(e.menuItems, convertUnitsCommand);
}
}
else if (e.menuType !== PopupMenuType.AutoFilter)
e.cancel = true;
}