Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Scott Bailey on Nov 17, 2008 02:15
open dhtmlx forum
Accordion Skins

Hello,

Re this question

http://www.dhtmlx.com/docs/products/kb/index.shtml?cat=17&page=1&q=5691

I have tried the solution in this answer but I get an error saying that setSkin is not a function.

This is the code that creates a window and attaches an accordion

var win2= dhxWins.createWindow("recordcard", 250,100,700,600);
win2.setText("Record Card");
var dhxAccord2.win2.attachAccordion();
dhxAccord2.setSkin("dhx_blue");

I get the error

dhxAccord2.setSkin("dhx_blue"); is not a function.

Without that line it all works but I get an unskinned accordion. I am using accordion elsewhere on the page with no problem its just the ones in the windows that are a problem

Many thanks
Scott Bailey
Answer posted by Support on Nov 17, 2008 03:22
Hello,

Right, skin should be passed into constructor like this:
var dhxAccord = new dhtmlXAccordion(parentId, "skin");

When initing through a window, skin inherits from a window skin. By the default window use "dhx_blue" skin,
and accordion use it too. Here is a demo:
http://dhtmlx.com/docs/products/dhtmlxWindows/samples/components/accordion.html?un=1226920890000
Answer posted by Scott Bailey on Nov 17, 2008 03:30

Hello,

So there is no way then to have one skin on the window and another on the accordion within it?

Scott

Answer posted by Support on Nov 17, 2008 03:43
You should edit some code for this:

dhtmlxwindows.js:

win.attachAccordion = function() {
    ...
    this.accordion = new dhtmlXAccordion(obj.id, that.skin);
    // replace that.skin this your skin
Answer posted on Nov 17, 2008 05:37

Many thanks

This worked great.