Open Kvasha123 opened 5 years ago
I would be okay with
$.contextMenu('update');
but this opens the closed menus as well
The selector should be the same as the selector that was used to initialize the contextmenu. So the selector on which the menu is bound.
$.contextMenu({
selector: '#ctxSelector a',
build: function($triggerElement, e){
return {
callback: function(){},
items: {
'item1': {
name: 'Item 1',
icon: 'fas fa-route'
},
'item2': {
name: 'Item 2',
icon: 'fas fa-draw-polygon'
}
}
}
}
});
So in my case, the selector would be '#ctxSelector a' ?
Yes it should be.
It's not working. And I have no idea why. I have JSF in my Project, could that be the problem?
Old topic but, try this: $.contextMenu('update', { context: $.contextMenu.menus[".contextMenu2"] }); // update single menu
if you're talking about updating only the 2nd created menu,
Actually, It seams to have a bug at the single menu update: I've changed the line 1656 to: op.update(o.context); And so, I've called the update like this: $.contextMenu('update', { context: [$.contextMenu.menus[".contextMenu2"]] }); The array "context" is required to pass some verification's.
I'm having the Problem, that i can't figure out how i specify a specific contextMenu that i want to update (change items to display as disabled).
You have the following functionality that i tried:
the second function works, but updates all menus (as said), but what selector should be used for the first function instead of $('.context-menu-one').
I tried to give the menu an class and use these class as selector, but no success.
I hope someone can help here