Closed nelnico closed 6 years ago
Wrapping context items in a computed did the trick
contextItems: Ember.computed(function () {
const ctx = this;
return [
{
label: 'Update',
action(selection, details, event) {
ctx.ctx_update();
}
}, {
label: 'Delete',
action(selection, details, event) {
ctx.ctx_delete();
}
}, {
label: 'Reset Grid',
action(selection, details, event) {
ctx.ctx_resetGrid();
}
}
];
}),
Closed, because topic starter has a working solution already. Using computed properties will do the trick indeed.
I'm trying to make the context menu work inside an Ember Light Table.
So far, upon right click, I make sure that the row you clicked on is the selected row and bring up a context menu. But inside actions (of contextItems) I seem unable to do anything to determine the selected row and call another method (must be inside the component, cannot outside like you got in the dummy)
Ember n00b, please bear with me....