How do I get multiple toolbars on the page with only one initialization. Right now I have 6 tabs in my tabbar and I want the toolbar to be at the top of each page but i have to call it like so:
var toolbar = new dhtmlXToolbarObject(“toolbarObj1”);
toolbar.setIconsPath("…/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");
var toolbar = new dhtmlXToolbarObject("toolbarObj2");
toolbar.setIconsPath("../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");
Because it doesn’t work if I try to call toolbarObj1 more than once… So I have to call toolbarObj1, toolbarObj2, toolbarObj3.
This is very messy, long code, help!