ContextMenuOptions
Interface
Properties
items_processor
OptionalProvide this function if you want to change the set of actions being displayed in the context menu.
You can filter out, add yours and re-order items.
The library will call your function each time it wants to display a context menu and will provide a list of items to display. This function should return an array of items to display.
Example:
context_menu: {
items_processor: function(items, actionsFactory, params) {
console.log(`Menu name is: ${params.menuName}`);
const newItem = actionsFactory.createAction({
actionId: 'hello-world',
label: 'Say Hello',
onExecute: function() {
alert('Hello World');
},
});
items.unshift(newItem);
return Promise.resolve(items);
},
},
Type
renderer_factory
OptionalNote: This API is experimental and might be changed significantly in the future releases. By providing this function you could override the default renderer for context menu.