Check documentation for the latest version 6.0 of dhtmlxSuite attachAccordion DHTMLX Docs

attachAccordion

attaches dhtmlxAccordion to a cell

dhtmlXAccordion attachAccordion( [object conf] );

Parameters

confobjectoptional, accordion config for object-api init

Returns

dhtmlXAccordiondhtmlXAccordion instance

Example

var myAcc = dhxComponent.cells(id).attachAccordion();
myAcc.addItem("a1", "First item", true);
myAcc.addItem("a2", "Second item");
 
// or
var myAcc = dhxComponent.cells(id).attachAccordion({
    icons_path: "icons/",
    items: [
        { id: "a1", text: "Main Page", icon: "flag_red.png" },
        { id: "a2", text: "Navigation", icon: "flag_green.png" },
        { id: "a3", text: "Feedback", icon: "flag_blue.png" }
    ]
});

Back to top