How to customize the context menu in the table component?
Question Description
How to customize the context in the header part of the table component to support different cells displaying different menu items.
Solution
In the menu attribute configuration option, configure contextMenuItems, which supports two configuration modes:
- Configure the item array, right-clicking the table area will display the same menu items
- Configure the callback function. Right-clicking the table area will display different menus according to the different items returned by the callback function
Menu item configuration:
- text: the text of the menu item
- menuKey: unique identifier of the menu item
After the drop-down menu item is selected, the "dropdownmenu_click" event will be triggered, and you can listen to the event and perform related operations.