[]
        
(Showing Draft Content)

GC.Spread.Sheets.ContextMenu.ContextMenu

Class: ContextMenu

Sheets.ContextMenu.ContextMenu

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new ContextMenu()

Represents ContextMenu

Properties

menuData: IMenuItemData[]

Represents the build-in menuData

property [name] - Represent context menu item's identify.

property [text] - Represent the text to be shown,if this context menu item is a group,text will be shown as DOM element's title.

property {string|Function} [command] - Represent a command name,commandManager will use this as index to find this command,if this command exist,then execute it.

property [disable] - Represent this context menu item is disabled under current condition, default value is false.

property [iconClass] - Represent this context menu item's icon,it is a class name.

property [group] - Represent this context menu item is a group menu item and this property's value should be it's group header's name.

property {Object[]} [subMenu] - Represent this context menu item has sub menu.

property [type] - Represent a context menu's type.

property [workArea] - Represent this context menu item's should be shown on what area,value can be a collection of conditions,separate by whitespace. include: "outline","rowHeader","colHeader","corner","slicer","chart","shape","table","vpWithoutTb","pivotPageFilter","pivotTopLeft","pivotEmptyLabel","pivotHeader","pivotGrandTotal","pivotContent","pivotTable".


menuView: MenuView

Represents the build-in menuView

Methods

onOpenMenu

onOpenMenu(menuData, itemsDataForShown, hitInfo, spread): boolean

open context menu

example

   var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
   spread.contextMenu.onOpenMenu = function (menuData, itemsDataForShown, hitInfo, spread) {
          console.log(menuData);
          console.log(itemsDataForShown);
          console.log(hitInfo);
          console.log(spread);
          //you can change itemsDataForShown to change filter result
          //if you only want to change filter result,return false or don't return anything
          //you also can open your own context menu,if you want to do this,return true
          //return true;
   };

Parameters

Name Type
menuData IMenuItemData[]
itemsDataForShown IMenuItemData[]
hitInfo Object
spread Object

Returns

boolean

indicate whether or not the contextmenu event has been processed done