Problems with submenu

Hello,

I have 2 problems with the submenus. Both illustrated via this snippet:
http://webix.com/snippet/e3109796

  1. Function showForm (which shows attached popup view) works only if called from top menu - see “Delete Node” in the menu.
  2. If the same function is called from submenu then the popup form is never shown, see “Delete from submenu”
  3. Another problem is that if I attach popup form as a submenu then I can’t actually click anything there as it is disappearing before I can hit the button. See “Actions\Delete node”

So how can I show an attached popup from submenu and add form as a submenu?

Thank you.

(1, 2) Popup is actually shown both times, but the second one is hidden immediately, as a click occurs outside this popup and Webix popups are hidden when users clicks elsewhere. This cannot be redefined.

But you can wrap showForm call into webix.delay function to let click event and popup live their own lives.

So, in both cases forms will be shown, but note that this points to a menu (not submenu you click) so they will be attached to a menu node.

http://webix.com/snippet/c3045c91

(3) I’m afraid you cannot modify such behaviour - a submenu component with data items can act as a submenu, not a custom popup.

Ok, may be you can put (3) as a feature request ( they have such thing in ExtJs for example ) .

I got it for (2) - is there a way to point the form to a submenu and not the whole menu?

Submenu object can be accessed as

var menu = this.getMenu(id);

but its node (menu.$view) will be already hidden by the time the onMenuItemClick handler is executed.

Ok, I’ll have to think of some other way to make it. But please consider (3) for future releases.