DHTMLX Docs & Samples Explorer

Attach dhtmlxTreeGrid to Accordion

Source
<script src="../../codebase/dhtmlxcommon.js"></script>
<script src="../../codebase/dhtmlxaccordion.js"></script>
<link rel="stylesheet" type="text/css" href="../../codebase/skins/dhtmlxaccordion_dhx_skyblue.css">
<script src="../../codebase/dhtmlxcontainer.js"></script>
 
<script src="../../../dhtmlxGrid/codebase/dhtmlxgrid.js"></script>
<script src="../../../dhtmlxGrid/codebase/dhtmlxgridcell.js"></script>
<link rel="stylesheet" type="text/css" href="../../../dhtmlxGrid/codebase/dhtmlxgrid.css">
<link rel="stylesheet" type="text/css" href="../../../dhtmlxGrid/codebase/skins/dhtmlxgrid_dhx_skyblue.css">
<script src="../../../dhtmlxTreeGrid/codebase/dhtmlxtreegrid.js"></script>
 
<div id="accordObj" style="position: relative; width: 320px; height: 400px;"></div>
<script>
var dhxAccord;
function init() {
    dhxAccord = new dhtmlXAccordion("accordObj");
    dhxAccord.addItem("a1", "dhtmlxTreeGrid");
    dhxAccord.addItem("a2", "b");
    dhxAccord.addItem("a3", "c");
    dhxAccord.openItem("a1");
    //;
    var treegrid = dhxAccord.cells("a1").attachGrid();
    treegrid.setSkin("dhx_skyblue");
    treegrid.setImagePath("../../../dhtmlxGrid/codebase/imgs/");
    treegrid.loadXML("../../../dhtmlxLayout/samples/common/treegrid.xml");
}
</script>