Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Ben Durber on Mar 26, 2008 11:44
open dhtmlx forum
Loop through Toolbar items

Hi,

I am currently trying to loop through the items in the toolbar and set their properties to hidden, I then wish to show the specific items that I need.

As the items will often change I would like a quick way to either hide all or a call to retrieve all child nodes

e.g.

children = menu_a.item('File').getChildId(); //would return array(save, print, exit)
hide_all = menu_a.hideItems(children);

What is the easiest solution?

Also, I suspect it would be worth while having a showItems() function in addition to the showItem.

Thanks

Ben
Answer posted by Support on Mar 27, 2008 03:36
>>Also, I suspect it would be worth while having a showItems() function in addition to the showItem.
Actually such api already exists

menu.showButtons(id_list);
menu.hideButtons(id_list);

To get sub items you can use

var panel=menu.getPanel(id); //id - id of top level item
panel.items - array of all child menu items