Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by tcscottc on Jan 03, 2009 19:49
open dhtmlx forum
css on sub_row

I have a grid with a sub_row. How do I get the sub_row detail to keep the CSS format of the parent row?

Example: http://www.blacktwig.com/playoffs/grid.php
Code:
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link rel="STYLESHEET" type="text/css" href="codebase/dhtmlxgrid.css">
<style>
.even{
background-color:#FFFFFF;
}
.uneven{
background-color:#f1f1f1;
}
    .grid_hover {
background-color:#d2d2d2;
}

</style>
<script src="codebase/dhtmlxcommon.js"></script>
<script src="codebase/dhtmlxgrid.js"></script>
<script src="codebase/dhtmlxgridcell.js"></script>
<script src="codebase/dhtmlxgrid_excell_sub_row.js"></script>
<script>
var mygrid;
function doInitGrid(){

mygrid = new dhtmlXGridObject("gridbox");
mygrid.setImagePath("codebase/imgs/");
mygrid.setHeader("Pd,+,Team,Week 1,Week 2,Week 3,Week 4,Total");
mygrid.setInitWidths("30,30,190,55,55,55,55,65");
//mygrid.setEditable(false);
mygrid.setSkin("gray");
//mygrid.setNumberFormat("0,000",0);
//mygrid.setNumberFormat("0,000",2);
mygrid.setColTypes("img,sub_row,ro,ro,ro,ro,ro,ro");
mygrid.setColAlign("center,center,left,center,center,center,center,center");
mygrid.setColSorting("str,str,str,int,str,int,int,int");
mygrid.enableAutoHeight(true,"1000");
mygrid.enableAlterCss("even","uneven");
mygrid.enableRowsHover(true,'grid_hover');
mygrid.init();
mygrid.loadXML("standings.xml")
}
</script>
</head>

<body onload="doInitGrid();">
<div id="gridbox" style="width:541px; background-color:white; overflow:hidden"></div>

</body>
</html>

Thanks in advance for any assistance!
Scott
Answer posted by Support on Jan 10, 2009 08:49
>>How do I get the sub_row detail to keep the CSS format of the parent row?
If I understood correctly, you need to have sub row with same styles as assigned to master row , right?
Unfortunately there is no simple way to implement such behavior, the only possible solution - code modification of dhtmlxgrid_excell_sub_row.js

dhtmlXGridObject.prototype._expandMonolite=function(n,show,hide){
...
d.className="dhx_sub_row";
that.objBox.appendChild(d);

in this point d - area of sub row
row - html element of master row 
you can add any custom code to set necessary styles for sub row