Wondering if there is a better way to disable all of the items in both Event and Column Context Menus. We've created the following workarounds:
features: {
tree: true,
scheduleContextMenu: {
items: {
addEvent: false
}
},
contextMenu: {
processCellItems: ({ record, items }) => {
if (record.isParent) { return false; }
items.length = 0; // hack to remove delete event item
items.push({
text: 'Edit Booking',
onItem: ({ record }) => { ... }
});
},
},
eventContextMenu: {
defaultItems: {
deleteEvent: false,
},
processItems({ eventRecord, items }) {
delete items._super; // hack to remove empty menu item
},
items: {
editBooking: {
text: 'Edit Booking',
onItem: ({ eventRecord }) => { ... }
},
},
},
},
For contextMenu
, I wasn't able to remove the "Delete Record" button without basically deleting the items
array in processCellItems
by setting the length to 0.
For eventContextMenu
, setting deleteEvent
to false does get rid of the buttons, however, there is an empty item that shows up.
Thanks for your help!