You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 14, 2021. It is now read-only.
As you can see, the submenu is modified in the "beforeOpen" function - and this seems to remove the submenu completely.
The context of this is a multi-user interface, where I would like to offer the users valid actions only (instead of offering all actions and erroring out if the action became invalid in the meantime by other user's action), therefore the need for modification at the click-time.
I also tried to modify the "ul" which is the base for the context menu, but here I face other issues:
when trying to replace the whole menu in the "beforeOpen", the menu does not show up at all
when replacing only the dynamic part, the submenu title is removed (and replaced by the #identifier of the "
" element...)
when replacing the dynamic part and then explicitly setting the title (by calling "setEntry", "entry", "title" again), the title is shown as expected but the behaviour breaks: I then cannot click on the submenu item without explicitly clicking on the submenu first.
Any suggestions?
The text was updated successfully, but these errors were encountered:
That's true, nested entries are not yet supported. Thanks for bringing this up
I guess if you initialize from an ajax call, you want to open another request, because you probably have to defer the opening until the request returns.
Something like this: a modification of the beforeOpen event:
we could allow to return a deferred/promise, and the context menu open would be delayed until the promise is resolved.
You are right, I completely missed the fact that the execution of
"beforeOpen" continues even after the ajax call is initialized... How could
I miss that?
I modified my ajax call to be synchronous now (yes, this does generates a warning in the Firefox console for me every time because sync calls on main thread are discouraged) - nevertheless no luck, cannot update the structure.
I have defined a context menu with a submenu, which (the submenu) needs to be populated dynamically (through an ajax call).
Whatever I do, the submenu is converted to a plain entry as soon as I call "setEntry" on it.
Here is the relevant code: http://jsfiddle.net/yuwLc47b/
As you can see, the submenu is modified in the "beforeOpen" function - and this seems to remove the submenu completely.
The context of this is a multi-user interface, where I would like to offer the users valid actions only (instead of offering all actions and erroring out if the action became invalid in the meantime by other user's action), therefore the need for modification at the click-time.
I also tried to modify the "ul" which is the base for the context menu, but here I face other issues:
Any suggestions?
The text was updated successfully, but these errors were encountered: