Skip to main content

PopupMenuType Enum

Lists values that identify the context menu type.

Declaration

enum PopupMenuType {
    ColumnHeading,
    RowHeading,
    SheetTab,
    Picture,
    Chart,
    Cell,
    AutoFilter,
    PivotTable,
    PivotTableAutoFilter
}

Members

Name Description
AutoFilter

Specifies a context menu for the AutoFilter drop-down arrow.

Cell

Specifies a context menu for a cell in a worksheet.

Chart

Specifies a context menu for a chart in a worksheet.

ColumnHeading

Specifies a context menu for a column header.

Picture

Specifies a context menu for a picture embedded in a worksheet.

PivotTable

Specifies a context menu for a cell in a pivot table.

PivotTableAutoFilter

Specifies a context menu for the AutoFilter drop-down arrow on the row or column label of a pivot table.

RowHeading

Specifies a context menu for a row header.

SheetTab

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;
}