DHTMLX Touch documentation

How to attach pop-up menu to the button?

You can easy attach pop-up to the toolbar button.


Full code of the example in the picture.

This calls for just 2 things:
The first one: create popup object and make it invisible.

dhx.ui({
	view:"popup",
	id:"Menu1",
	body:{
		view:"list",
		url:"menu.xml", datatype:"xml",
		select:true, y_count:3
	}
}).hide();

The other: define toolbar button (you'd like attach popup 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({
	    rows:[
		  { view:"toolbar", type:"MainBar", data:[{ type:"button", label: "Menu", popup:"Menu1"}]
		 }]
...
})

That's all code you need. Just unite 2 code snippets and the popup button is ready.