Hi,
Is it possible to attach a Contextmenu to a Tabbar?
I want to add the functionality to
* close all Tabs
* close all Tabs except the activ one
I have a script for closing all tabs, but don’t know how to build up the contextmenu.
Hello
there isn’t built-in functionlaity. You can use the following appproach to attach dhtmlxmenu as context menu to tabbar header:
tabbar._tabZone.id=“theader”;
menu.addContextZone(“theader”);
where tabbar is tabbar object, menu is menu object.
Sorry, i don’t get it working.
>> dhxtabbar._tabZone.id=“theader”;
dhxtabbar._tabZone.id is a global variable for the Tabbar or do i have to set it for each Tab?
I’m doing the following initialization:
var menu1;
function initMenu() {
menu1 = new dhtmlXMenuObject();
menu1.setIconsPath(“dhtmlx/imgs/”);
menu1.renderAsContextMenu();
dhxtabbar._tabZone.id=“theader”;
menu1.addContextZone(“theader”);
menu1.loadXML(“dhxmenu.xml”);
}
anything wrong here?
_tabZone is an exstent tabbar property (private). It is a container with tabs.
dhxtabbar._tabZone.id sets id for that container in order to apply addContextZone. The provided code looks correct. Please provide the complete demo to recreate the issue