Skip to main content

defaultMenuOptions

Description

An array of objects with default configuration parameters for context menu items

Default config

[
{
id: "add-row:before",
text: "Add before",
icon: "wxi-table-row-plus-before",
},
{
id: "add-row:after",
text: "Add after",
icon: "wxi-table-row-plus-after",
},
{
id: "copy-row",
text: "Copy",
icon: "wxi-content-copy",
},
{
id: "cut-row",
text: "Cut",
icon: "wxi-content-cut",
},
{
id: "paste-row",
text: "Paste",
icon: "wxi-content-paste",
},
{
id: "move-item:up",
text: "Move up",
icon: "wxi-angle-up",
},
{
id: "move-item:down",
text: "Move down",
icon: "wxi-angle-down",
},
{ comp: "separator" },
{ id: "delete-row", text: "Delete", icon: "wxi-delete-outline" },
];
note

ContextMenu options with the ids "move-item:up" and "move-item:down" appear only when the Grid is configured in reorder mode:

<Grid data={data} columns={columns} reorder />

Parameters

The array contains objects with the next parameters for each menu item:

  • id - the id of a menu item
  • text - the text for an item
  • icon - the name of an icon displayed before the text. It converts to adding i className={item.icon}, so any icons with the wxi- prefix can be used here, e.g. .wxi-plus or any custom icons defined on the page.
  • type - the type of an item. It can be a "separator" or a custom type registered as a menu item (e.g. type: "button")
  • data - an array of sub items for a menu item.

Please, also refer to ContextMenu options.


Related articles: