parent - string or object, id of container, where tree will be initialized, mandatory
image_path - string, path to image folder, which will be used for icons in tree
skin - {string} changes menu skin(
setSkin)
menu items can be defined through items collection
menu = new dhtmlXMenuObject({
parent:"a_menu",
items:[
{id:"t1", text:"Top 1", items:[
{id:"ch1", text:"child 1"},
{id:"ch2", text:"child 2"}
]}
]
});
Each item can have next attributes
id - {string} id of menu item
text - {string} caption of menu item
img - {sting} url of image related to menu item
disabled - {boolean} disabled state
img_disabled - {sting} url which will be used for item in disabled state
any event can be assigned by using property equal to event name
menu = new dhtmlXMenuObject({
parent:"a_menu",
onClick:function(){
alert("Item was clicked");
}
});