attachTo

attaches a context menu to a Webix component or an HTML element

void attachTo(object|HTMLElement target);
targetobject|HTMLElementWebix view object or an HTML element

Example

webix.ui({
    view: "list",
  ...  // list config
});
 
webix.ui({
    view: "contextmenu",
  ...  // contextmenu config
});
 
$$("contextmenu1").attachTo($$("list1"));

Related samples

Details

The component and context object are initialized in different Webix constructors (as seen above). The context menu isn't shown initially and becomes visible on right mouse click with the cursor pointed over the list area.

See also
Back to top
Join Our Forum
We've retired comments here. Visit our forum for faster technical support, connect with other developers, and share your feedback there.
If you have not checked yet, be sure to visit site of our main product Webix best ui framework and page of javascript context menu product.