Attaching pop-up menu

Problem

How to attach pop-up menu to a button?

Solution

Pop-up can be easily attached to any button:

This calls for just 2 things:

  1. Create a POPUP object and make it invisible.

    dhx.ui({
    	view:"popup",
    	id:"Menu1",
    	body:{ ... }
    }).hide(); 
  2. Define a button (you'd like attach pop-up to) and set the parameter popup to the desired POPUP object (in our example, it's “Menu1”).
    If you want, you can specify which side the pop-up will appear from: right, center or left (popup:“Menu1, right”). The default value is “center”.

    dhx.ui({
    	  { view:"toolbar", type:"MainBar", elements:[{ view:"button", label: "Menu", popup:"Menu1, left"}]
    })

Related sample: 08_window/13_button_popup.html