setwidth of TB_new

Hi,

I have a problem with the toolbar and maybe you can help me out.
On my page I succesfully initialized the toolbar with:

var toolbar = new dhtmlXToolbarObject(“toolbar”,“dhx_blue”);
    toolbar.setIconsPath(“icons/”);
    toolbar.loadXML(“toolbar.xml”);

So far, so good… however, as soon as I try to set the width of a buttonselect item, the script crashes.
on your sample and documentation database I have found this syntax:

webBar.setWidth(itemId, width);
Therefore my line of code was: toolbar.setwidth(“TB_new”,’'100");
however, the script crashes as soon as I add this line. Dreamweaver does not show the parameter itemID… you can only add the width.

I already tried a couple of things, but I do not seem to get it to work.

<?xml version="1.0"?>
   
       
        
            
            
            
            
            
        
       
       
        
            
            
            
            
        
        


Hello,


Please, check that you call setWidth after xml loading:


toolbar.loadXML(“toolbar.xml”,doAfterXMLLoading);


function doAfterXMLLoading(){


toolbar.setWidth(“TB_new”,’‘100");


}


Also you should check the case of the setWidth method (as you whote toolbar.setwidth(“TB_new”,’'100");).


Please, take a look at the attached sample - dhtmlx.com/docs/products/dhtmlxT … width.html

Hello,

Is it also possible to incorporate some parameter in the XML file to take care of this issue?
There is actually no real need to resize the object, if the buttonSelect can already initialize with the correct width…

Cheers and thanks for your help

By the way, the provided solution works like a charm!