Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by john on Nov 18, 2008 05:48
open dhtmlx forum
dhtmlxlayout

whats wrong with this....
<html>
<head>
    <title>Demo</title>
    <link rel="stylesheet" type="text/css" href="../../codebase/dhtmlxlayout.css">
    <link rel="stylesheet" type="text/css" href="../../codebase/skins/dhtmlxlayout_dhx_blue.css">
    <link rel="stylesheet" type="text/css" href="../../codebase/dhtmlxwindows.css">
    <link rel="stylesheet" type="text/css" href="../../codebase/skins/dhtmlxwindows_dhx_blue.css">
    <link rel="stylesheet" type="text/css" href="../../codebase/skins/dhtmlxaccordion_dhx_blue.css">
    <link rel="stylesheet" type="text/css" href="../../codebase/dhtmlxgrid.css">
    <link rel="stylesheet" type="text/css" href="../../codebase/skins/dhtmlxgrid_dhx_blue.css">
    <link rel="STYLESHEET" type="text/css" href="../../codebase/grid/dhtmlxgrid.css">

    <script src="../../codebase/grid/dhtmlxcommon.js"></script>
    <script src="../../codebase/grid/dhtmlxgrid.js"></script>
    <script src="../../codebase/grid/dhtmlxgridcell.js"></script>

    <script src="../../codebase/dhtmlxcommon.js"></script>
    <script src="../../codebase/dhtmlxlayout.js"></script>
    <script src="../../codebase/dhtmlxwindows.js"></script>
    <script src="../../codebase/dhtmlxaccordion.js"></script>
    <script src="../../codebase/dhtmlxgrid.js"></script>
    <script src="../../codebase/dhtmlxgridcell.js"></script>
</head>
<body style="width: 100%; height: 100%; overflow: hidden; margin: 0px;">
<script>
    var dhxLayout = new dhtmlXLayoutObject(document.body, "3J");

    dhxLayout.cells("a").hideHeader();
    dhxLayout.cells("a").setWidth(150);
    dhxLayout.cells("a").setHeight(150);
dhxLayout.cells("a").attachURL("Task.html");
    dhxLayout.cells("c").hideHeader();
    dhxLayout.cells("b").setText("Report Details");
    //dhxLayout.cells("b").attachURL("Parent.html");

var dhxGrid = dhxLayout.cells("a").attachGrid();
    dhxGrid = new dhtmlXGridObject('mygrid_container');
    dhxGrid.setImagePath("../../codebase/grid/imgs/");
dhxGrid.setHeader("Task");
dhxGrid.setInitWidths("*");
dhxGrid.setColAlign("left");
dhxGrid.setSkin("light");
    dhxGrid.attachEvent("onRowSelect",GetmetheItem);
dhxGrid.init();
    dhxGrid.setColTypes("ro");
dhxGrid.loadXML("items.xml");

    function GetmetheItem(id,index){
    return true;
    }

</script>

<div id="mygrid_container" style="width:100px;height:110px;"></div>

</body>
</html>
Answer posted by Support on Nov 18, 2008 06:48
1. Checkout your paths for included js/css (they should be correct)
2. When you attaching grid into layout through the dhxLayout.cells("a").attachGrid() you did not need to call dhxGrid = new dhtmlXGridObject('mygrid_container');
it will different object, just keep dhxLayout.cells("a").attachGrid() and in this case container for grid will created automatically, so you didn't need
<div id="mygrid_container" style="width:100px;height:110px;"></div>