DHTMLX Docs & Samples Explorer

Attach dhtmlxGrid 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">
 
<div id="accordObj" style="position: relative; width: 320px; height: 400px;"></div>
<script>
var dhxAccord;
function init() {
    dhxAccord = new dhtmlXAccordion("accordObj");
    dhxAccord.addItem("a1", "dhtmlxGrid");
    dhxAccord.addItem("a2", "b");
    dhxAccord.addItem("a3", "c");
    dhxAccord.openItem("a1");
    //;
    var grid = dhxAccord.cells("a1").attachGrid();
    grid.setSkin("dhx_skyblue");
    grid.setImagePath("../../../dhtmlxGrid/codebase/imgs/");
    grid.loadXML("../../../dhtmlxWindows/samples/common/grid.xml");
}
</script>