[]
Sheets.ContextMenu.ContextMenu
• new ContextMenu()
Represents ContextMenu
• 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
▸ 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;
};
| Name | Type |
|---|---|
menuData |
IMenuItemData[] |
itemsDataForShown |
IMenuItemData[] |
hitInfo |
Object |
spread |
Object |
boolean
indicate whether or not the contextmenu event has been processed done