Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by dklein on Oct 21, 2008 02:01
open dhtmlx forum
Accordion: Using Skins in Windows

I added an accordion to an existing window. I have no problems with the data but with my selected skin. Instead of using the selected black skin he is not using any of them, not even the default one. The path to the dhx_black.css is correct, because I am able to use the windows skins which are using the same folder structure. Here is my code:

css:
<link rel="stylesheet" type="text/css" href="../../../../../dhtmlxAccordion/codebase/skins/dhtmlxaccordion_dhx_black.css" />

code:
<script>
    // action area
    var dhxWins_rechts = new dhtmlXWindows();
    dhxWins_rechts.enableAutoViewport(false);
    dhxWins_rechts.attachViewportTo("col2_content");
    dhxWins_rechts.vp.style.border = "#909090 0px solid";
    dhxWins_rechts.setImagePath("../../../../../dhtmlxWindows/codebase/imgs/");
    dhxWins_rechts.setSkin("web")
    
    // window creation
    var w_rechts = dhxWins_rechts.createWindow("w_rechts", 10, 10, 170, 200);
    
    // setup of the window
    w_rechts.setText("Navigation");
    w_rechts.denyPark(false);
    w_rechts.button("close").hide();
    dhxWins_rechts.window("w_rechts").denyMove();
    dhxWins_rechts.window("w_rechts").denyResize();


// setup of the accordion
    dhxAccord_rechts = w_rechts.attachAccordion();
    dhxAccord_rechts.addItem("a1", "Suche");
    dhxAccord_rechts.cells("a1").attachObject('suche');
    dhxAccord_rechts.addItem("a2", "Warenkorb");
    dhxAccord_rechts.cells("a2").attachObject('warenkorb');
    dhxAccord_rechts.addItem("a3", "Service");
    dhxAccord_rechts.cells("a3").attachObject('service');
    dhxAccord_rechts.openItem("a2");
    dhxAccord_rechts.setEffect(true);
</script>

Like I said, no skin is used.... but why? :(
Answer posted by Support on Oct 21, 2008 06:46
dhtmlxAccordion inherits dhtmlxWindows skin. There is a "web" skin is a choosen one for windows, but there is no such skin for accordion,
besides attached absolutely different file (dhtmlxaccordion_dhx_black.css).

Try to attach dhtmlxaccordion_dhx_black.css and dhtmlxwindows_dhx_black.css and run the following code:
    ...
    dhxWins_rechts.setSkin("dhx_black"); // or any other

Or set your own skin to accordion different from window:
    ...
    // setup of the accordion
    dhxAccord_rechts = w_rechts.attachAccordion();
    dhxAccord_rechts.setSkin("dhx_blue"); // in this case you should attach dhtmlxaccordion_dhx_blue.css
    ...