attachToolbar skin

Is there any way to change the skin of a toolbar when that toolbar is created from a layout or window object? Basically, I have a window object upon which I call:



myWindow1ToolBar = myWin.window(“myWindow1”).attachToolbar();



After this call, the myWindow1ToolBar is a toolbar object that inherits its skin from the window object. Is there any way that I can change the skin of the myWindow1ToolBar after creation?



I want this toolbar to have a different skin (dhx_customblue) while keeping the other toolbars on the page skinned with dhx_blue.



Thanks!


You can set the necessary skin directly in the dhtmlxwindows_wtb.js.


Please, try to set the necessary skin name instead of the this.skin in the following line:


win.toolbar = new dhtmlXToolbarObject(win._toolbarId, this.skin);

Yeah, I found that but I don’t know if I want to hardcode it directly in the module.  I suppose I could make the edit in a copied module and import that one when I need it.  Still not the best solution though.  It’d be nice if attachToolbar could take a skin.  For that matter, any of the attach_____() functions (toolbar, layout, menu, window, etc.) should be able to take a skin in any of the modules (layout, window, etc).

~Ben



You can add the tskin (toolbar skin) property to the window.


The modification in the dhtmlxwindows_wtb.js:


win.toolbar = new dhtmlXToolbarObject(win._toolbarId, this.tskin?this.tskin:this.skin);


instead of


win.toolbar = new dhtmlXToolbarObject(win._toolbarId, this.skin);


And then in the script:


var dhxWins = new dhtmlXWindows();





dhxWins.tskin = “custom”;
var toolbar = w1.attachToolbar();



Thanks, that worked.  Now, what’s the equivalent modification for a toolbar attached to an dhtmlxAccordion?

~Ben


The following approach can be applied with the provided modification in the dhtmlxwindows_wtb.js file:





dhxAccord.dhxWins.tskin = “custom”;
var toolbar = dhxAccord.cells(itemId).attachToolbar();