Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Swapnil Deshmukh on Aug 27, 2009 02:33
open dhtmlx forum
dhtmlXGridFromTable height problem

Dear Sir,
I have problem with dhtmlXGridFromTable, when I changed the grid height to 100% or any % value, then vertical length of page automatically keep increasing and not stop. The same problem I have with the dhtmlXGrid, when I set width and height 100%. Please find below code

<script type="text/javascript" language="javascript">
var leftGrid="", rightGrid="";
function getStackData(){
leftGrid = new dhtmlXGridFromTable('laftTable');
leftGrid.setImagePath("dhtmlx/dhtmlxTreeGride/codebase/imgs/icons_books/");
leftGrid.sortRows(4, 'int', 'des')
leftGrid.enableEditEvents(false, false, 'disable');

rightGrid = new dhtmlXGridFromTable('rightTable');
rightGrid.setImagePath("dhtmlx/dhtmlxTreeGride/codebase/imgs/icons_books/");

rightGrid.sortRows(4, 'int', 'asc');
rightGrid.enableEditEvents(false, false, 'disable');

}

function doOnBeforeInit(){
lgrid.enableMultiline(true);
lgrid.setSkin('xp');
lgrid.setColSorting("str,int,int,str,int,int,int,str,int,int");

}

function doOnBefore(){
rgrid.enableMultiline(true);
rgrid.setSkin('xp');
rgrid.setColSorting("str,int,int,str,int,int,int,str,int,int");
}
</script>

<body onload="getStackData()" style="width:100%; height:100%" >
<table style="width:98%; height:100%; visibility:hidden" name="lgrid" id="laftTable" gridWidth="98%" gridHeight="100%" onbeforeinit="doOnBeforeInit()" >
                     <tr>
                         <td width="7"> </td>
                         <td width="40" align="center">DPM</td>
                        <td width="34" align="center">Sev</td>
                        <td width="90" align="center">Risk</td>
<td width="55" align="center">Adj Nom</td>
<td width="55" align="center">Adj Tol</td>
                        <td width="45" align="center">%Cont</td>
                        <td width="*" align="center">Stack # </td>
                        <td width="86" align="center">Cpk/Cpk Req </td>
<td width="45" align="center">Sens</td>
                     </tr>
                     <%for(int i=0 ; i< left.size();i++){
                     String tempValues=(String)left.get(i);
                     String[] values=tempValues.split("~",0);
                     %>
                <tr bgcolor="#FFFFFF" >
                    <td bgcolor="<%=values[9]%>"> </td>
                    <td height="30" align="center"><%=values[1]%></td>
                    <td align="center"><%=values[0]%></td>
                    <td align="left"><%=values[2]%></td>
                    <td align="center"><%=values[11]%></td>
<td align="center"><%=values[12]%></td>
                    <td align="center"><%=values[10]%></td>
                    <td align="left"><a href="stack_view.jsp?stack_id=<%=values[7]%>" target="_self"><%=values[5]%></a><br /><%=values[4]%></td>
                    <td align="center"><%=values[6]%></td>
<td align="center"><%=values[3]%> </td>
                </tr>

                <%}%>
</table>

<table style="width:98%; height:100%;visibility:hidden" id="rightTable" name="rgrid" gridWidth="98%" gridHeight="100%" onbeforeinit="doOnBefore()">
                    <tr>
                        <td width="7"> </td>
                         <td width="40" align="center">DPM</td>
                        <td width="34" align="center">Sev</td>
                        <td width="90" align="center">Risk</td>
<td width="55" align="center">Adj Nom</td>
<td width="55" align="center">Adj Tol</td>
                        <td width="45" align="center">%Cont</td>
                        <td width="*" align="center">Stack # </td>
                        <td width="86" align="center">Cpk/Cpk Req </td>
<td width="45" align="center">Sens</td>
                 </tr>
                     <%for(int j=0 ; j< right.size();j++){
                     String temprightValues=(String)right.get(j);
                     String[] rightvalues=temprightValues.split("~",0);
                     %>
                    <tr bgcolor="#FFFFFF" >
                        <td bgcolor="<%=rightvalues[9]%>"> </td>
                        <td height="30" align="center"><%=rightvalues[1]%></td>
                        <td align="center"><%=rightvalues[0]%></td>
                        <td align="left"><%=rightvalues[2]%></td>
                        <td align="center"><%=rightvalues[11]%></td>
<td align="center"><%=rightvalues[12]%></td>
                        <td align="center"><%=rightvalues[10]%></td>
                        <td align="left"><a href="stack_view.jsp?stack_id=<%=rightvalues[7]%>" target="_self"><%=rightvalues[5]%></a><br /><%=rightvalues[4]%></td>
                        <td align="center"><%=rightvalues[6]%></td>
<td align="center"><%=rightvalues[3]%> </td>
                </tr>
                <%}%>
             </table>
</body>
Answer posted by dhxSupport on Aug 28, 2009 02:38
Unfortunately we cannot reproduce this issue locally. Please provide us complete example where we can reproduce it including all files which you are using to initialize grid.