setwidth of TB_new


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”);

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"?>


Please, check that you call setWidth after xml loading:


function doAfterXMLLoading(){



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 - … width.html


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!