dhtmlxmenu items width

Hi ,

How can I set the items of the menu to be with the same width size?

(and not according to the width of the words inside the menu).

Thanks.

Hello,

Could you please provide more details?

Hi,

for example, look at the sample “Initialization from XML” when you open the “Edit” menu , it’s size is diffrent then the one that opens when you stand on the “Help” menu.

so my question is how can i set those sizes to be the same in every item and not diffrent according to the text size?

i hope this was clearer,

Please Advice,

Thanks.

Hello,

Please try this:

var menu = new dhtmlXMenuObject(...);
menu.loadXML("server.php?params", function(){
	for (var a in menu.idPull) {
		if (String(a).search("polygon_"+menu.idPrefix)===0) {
			menu.idPull[a].style.width = "200px";
			menu.idPull[a].childNodes[0].style.width = "200px";
		}
	}
});

Note: “menu” should be declared as global variable.

Hi,

Thanks, works good ,

Is it possible to set the size dynamically, set the minimum size to X pixels, but if the
menu item content (text) exceeds the minimum size , it will resize the menu accordingly?

Please Advice.

Do you mean:

width of any sublebel polygon should be >= min size
and all polygons may have different size at time (depending on content),

right?

exactly right , how can this be done?

WIll you change itemsets on the fly (adding/removing items to/from sublevels) or menu will static once loaded?

The menu will stay static once loaded…

Please see attached demo, change in dhtmlxmenu.js line 280, comments inside.
35.zip (62 KB)

Thanks!!! works great.