how we can add two Toolbars within one page??
In 2 different divs, which are placed under each other.
But if you create your toolbar via method attachToolbar() - we need to know your page-structure.
I want to add one tool bar at the top of the page and other one is inside the layout. I have added one inside the layout using
var toolbar = new dhtmlXToolbarObject("toolbarObj");
toolbar = dhxLayout.cells("a").attachToolbar();
But can’t add a one in top of page using a new dev tag.
What is your layout? Is it fulscreen?
You can do the next:
dhxLayout = new dhtmlXLayoutObject("parentId", "3T");
dhxLayout.cells("a").hideHeader();
tlb1 = dhxLayout.attachToolbar();
tlb1.setIconsPath("../dhtmlxtoolbar/common/imgs/");
tlb1.loadXML("../toolbar.xml");
tlb2 = dhxLayout.cells("a").attachToolbar();
tlb2.setIconsPath("../dhtmlxtoolbar/common/imgs/");
tlb2.loadXML("../toolbar.xml");
No its not full screen.
this is it.
dhxLayout = new dhtmlXLayoutObject("parentId", "2U");
What size has your “parentId”?
Is it possible to attach a single toolbar on the main layout and change it dynamically depending on the active tab on a tabbar attached to the layout??
Yes
Here is an approach for you:
[code]var tabbar, toolbars;
dhtmlxEvent(window,“load”,function(){
tabbar = new dhtmlXTabBar(“userTab”, “top”);
tabbar.setSkin(‘dhx_skyblue’);
tabbar.setImagePath("…/dhtmlxTabbar/codebase/imgs/");
tabbar.setSkinColors(“white”,"#FFFACD");
tabbar.setStyle(“dhx_skyblue”);
tabbar.addTab(“a1”, “Tab 1-1”, “100px”);
tabbar.addTab(“a2”, “Tab 1-2”, “100px”);
tabbar.addTab(“a3”, “Tab 1-3”, “100px”);
tabbar.addTab(“a4”, “Tab 1-4”, “100px”);
tabbar.addTab(“a5”, “Tab 1-5”, “100px”);
tabbar.addTab(“a6”, “Tab 1-6”, “100px”);
toolbars = {};
tabbar.attachEvent("onSelect", function(id){
if (!toolbars[id]){
var toolbar = tabbar.cells(id).attachToolbar();
toolbar.setIconsPath("../dhtmlxToolbar/codebase/imgs/");
toolbar.setSkin("dhx_skyblue");
toolbar.addSeparator("sep", 1 );
toolbar.addButton("print", 3, "Print Documents", "print.gif", "print_dis.gif");
toolbar.addButton("email", 2, "Send Message", "email.png", "email.png");
var opts = [['id1', 'obj', 'New Opportunity', 'img1'],
['sep01', 'sep', '', ''],
['id2', 'obj', ' Opportunity Analysis', 'img2'],
['sep02', 'sep', '', ''],
['id3', 'obj', 'Pursuit Strategy & Approval', 'img3'],
['sep03', 'sep', '', ''],
['id4', 'obj', 'RFP or Supplier Selection', 'img4'],
['sep04', 'sep', '', ''],
['id5', 'obj', 'Contract Negotiations', 'img5'],
['sep05', 'sep', '', ''],
['id6', 'obj', 'In Approval Process', 'img6'],
['sep06', 'sep', '', ''],
['id7', 'obj', 'Implemented', 'img7'],
['sep07', 'sep', '', ''],
['id8', 'obj', 'Discontinued', 'img8']
];
toolbar.addButtonSelect("select", 0, "Progress", opts, "cut.gif", "cut_dis.gif", "true", "true");
toolbars[id] = toolbar;
}
return true;
});
})[/code]
i wanted a toolbar on the main layout not on tabs
Ahhh, sorry. Now understand
toolbar = layout.attachToolbar();
tabbar.attachEvent("onSelect", function(id,last_id){
if(id == "id"){
toolbar.clearAll();
toolbar.loadXML(path, aftercall)
}
return true;
});
i tried the tabbar onSelect event but got an empty page that displayed no content
Provide us completed demo
docs.dhtmlx.com/doku.php?id=othe … leted_demo
And we’ll try to help you exactly on your app