[ANGULAR] Show right click options depending on selected item
Posted: Thu Jul 22, 2021 5:25 pm
by casman.manzano
How would I go about changing what appears in the right click menu depending on what record the user is right clicking on, is there a handler for when user right clicks? so that I can show/hide options depending on the record?
Re: [ANGULAR] Show right click options depending on selected item
Re: [ANGULAR] Show right click options depending on selected item
Posted: Thu Jul 22, 2021 7:54 pm
by casman.manzano
ok so for example...
features: {
taskMenu: {
processItems({ items, taskRecord }) {
// Not possible to edit or delete tasks if there is no rights for it
console.log(taskRecord);
},
items: {
// Custom reference to the new menu item
moveForward: {
text: "Move 1 hour ahead",
weight: 90, // Add the item to the top
onItem: ({ taskRecord }) => {
taskRecord.shift(1, "hour");
},
},
},
},
if I wanted the "moveForward" item to appear in the menu depending on "taskRecord" hypothetical property (here let's pretend it's "show"), which holds a boolean. how would I make that happen?
Re: [ANGULAR] Show right click options depending on selected item