Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Rahul on Jul 06, 2009 04:01
open dhtmlx forum
subgrid

below link is detail of my previous query:

http://dhtmlx.com/docs/products/kb/index.php?s=normal&q=10389&a=16890

as per required to reproduce i am sending my code and xml.

-------------------------------------------------------CODE---------------------------------------------------------------

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<link href="dhtmlxmenu_dhx_blue.css" rel="stylesheet" type="text/css" />
<link rel="STYLESHEET" type="text/css" href="dhtmlxgrid.css">
<link href="codebase/dhtmlxtree.css" rel="stylesheet" type="text/css" />
<link rel="STYLESHEET" type="text/css" href="dhtmlxcombo.css">
<link href="dhtmlxwindows.css" rel="stylesheet" type="text/css" />
<link href="dhtmlxlayout.css" rel="stylesheet" type="text/css" />
<link href="dhtmlxtree.css" rel="stylesheet" type="text/css" />
<link href="dhtmlxwindows_dhx_blue.css" rel="stylesheet" type="text/css" />
<link href="dhtmlxlayout_dhx_blue.css" rel="stylesheet" type="text/css" />
<link href="dhtmlxwindows.css" rel="stylesheet" type="text/css" />
<link href="dhtmlxlayout.css" rel="stylesheet" type="text/css" />
<link href="dhtmlxwindows_dhx_blue.css" rel="stylesheet" type="text/css" />
<link href="dhtmlxlayout_dhx_blue.css" rel="stylesheet" type="text/css" />
<script src="dhtmlxlayout.js" type="text/javascript"></script>
<script src="dhtmlxwindows.js" type="text/javascript"></script>
    <script src="dhtmlxcombo.js"></script>
    <script src="dhtmlxcommon.js"></script>
<script src="dhtmlxlayout.js" type="text/javascript"></script>
<script src="dhtmlxwindows.js" type="text/javascript"></script>
<script src="dhtmlxgrid_filter.js"></script>
<script src="dhtmlxtree.js"></script>
<script src="dhtmlxgrid_group.js"></script>
<script src="dhtmlxgrid_excell_sub_row.js"></script>
<script src="dhtmlxtreegrid.js"></script>
<script src="dhtmlxgrid.js"></script>
<script src="dhtmlxgridcell.js"></script>
<script src="codebase/dhtmlxgrid_splt.js" type="text/javascript"></script>    
<script src="dhtmlxmenu.js" type="text/javascript"></script>
<script src="dhtmlxcommon.js"></script>

<script src="dhtmlxgrid_drag.js" ></script>
<script src="dhtmlxgrid_drag.js" ></script>



</head>
<body style="width:100%; height:100%; margin:0px; overflow:hidden;" onload="doInitGrid();">
<script>
var mygrid, grid;

function doInitGrid() {
layout();
grid1();
}

function grid1() {
mygrid = new dhtmlXGridObject('mygrid_container');

mygrid.setImagePath("App_Data/imgs");

mygrid.setColTypes("sub_row_grid,ed,ed,ed,ed");

mygrid.setHeader("s.no,book_name,auther,points,issue");
mygrid.attachHeader('#rspan,#rspan,#rspan,#rspan,#rspan');
mygrid.setInitWidths("80,70,70,80,30");

mygrid.setSkin("light");
mygrid.enableMultiline(true);
mygrid.enableMultiselect(true);

mygrid.init();

mygrid.loadXML("sub.xml");

mygrid.setColSorting("int,str,str,int,int,int,int,int");
}




function menu1() {
var menu = new dhtmlXMenuObject("menuObj", "aqua_orange");
menu.loadFromHTML("menuData", true);
}
function tree1() {
var tree = new dhtmlXTreeObject(document.getElementById('treeBox'), "100%", "100%", 0);
tree.setImagePath("");
tree.enableCheckBoxes(false);
tree.enableDragAndDrop(true);

}
function refresh() {
alert("test");

}
function layout() {
var dhxLayout = new dhtmlXLayoutObject("parentId", "3L", "dhx_blue");
dhxLayout.cells("a").attachObject("mygrid_container");
dhxLayout.cells("a").setText("My Book Detail");
}
</script>

<form id="form2" runat="server">



<div id="parentId" style="position:absolute; width:1000px; height:700px;"></div>

<div id="menuData" style="display: none;">
<div id="m1" text="File">
<div id="m11" text="New"></div>
<div id="ms1" type="separator"></div>
<div id="m12" text="Open"></div>
</div>
</div>


<div id="mygrid_container" style="width:330px;height:400px;"></div>




</form>
</body>
</html>


----------------------------------------------------------XML---------------------------------------------------------------------

<?xml version="1.0"?>
<rows>
<row id="1">
<cell type="sub_row">data.txt</cell>
<cell>Loaded by ajax</cell>
<cell>001</cell>
<cell>mickel sefered</cell>
<cell>0</cell>
</row>
<row id="2">
<cell type="sub_row">sub.xml</cell>
<cell >Sub grid 1</cell>
<cell>002</cell>
<cell>asto yani</cell>
<cell>0</cell>
</row>
<row id="3" >
<cell type="sub_row">sub.xml</cell>
<cell>Sub grid 2</cell>
<cell>003</cell>
<cell>king lee</cell>
<cell>1</cell>
</row>
<row id="4">
<cell>350</cell>
<cell>The Green Mile</cell>
<cell>004</cell>
<cell>yabuki singh</cell>
<cell>0</cell>
</row>
</rows>


----------------------------------------------------THANKS IN ADVANCE----------------------------------------------------

Answer posted by dhxSupport on Jul 06, 2009 07:10
We tested your code and it works without errors if all necessary files is included. Please check if all files is attached correctly.To do not forget what file to include you can generate one JS and one CSS file. You can do that using DHTMLX libComplier tool which is included at the suite package http://www.dhtmlx.com/docs/download.shtml. Please see more information here http://dhtmlx.com/docs/products/docsExplorer/doc/libCompiler/guide.html#libc_