Skip to content
This repository was archived by the owner on Aug 14, 2021. It is now read-only.
This repository was archived by the owner on Aug 14, 2021. It is now read-only.

setEntry does not work with submenus #80

Closed
@ghost

Description

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:

  • 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?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions