Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by ram on Jun 11, 2008 07:02
open dhtmlx forum
context menu with tree

Im using dhtmlxtree pro with context menu and have some questions.

1. Can i resize the menu items or change their style properties? (bgcolor, padding,...)

2. I want the menu to pop for only specific tree items but when im hiding the items with the OnShowMenuHandler the menu still pop (a thin empty line).


Answer posted by Support on Jun 11, 2008 10:03
>>1. Can i resize the menu items or change their style properties? (bgcolor, padding,...)
menu is instance of dhtlmxMenu and can be controlled by related API, there is no methods for separate properties, but you can define custom css class and assign it to menu item.
You can set custom class assigned to menuItem by using "className" attribute of related item in XML.
Or later change css class property by
    contextMenu.menu.getItem(ID).CSSTag.className="custom"


>>2. I want the menu to pop for only specific tree items but when im hiding the items
instead of hiding items, just add
    return false;
as last line of onShow handler - as result menu showing will be blocked ( it will stay hidden )