Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Tim Sanders on Nov 06, 2008 16:09
open dhtmlx forum
Footer disappears when grid changes

I have a grid I'm loading with AJAX and am trying to add a simple footer total of one column. I have two different issues with the two attachFooter lines in the snippet below:
1. The one commented out with #cspan gives an error about being undefined.
2. The one with dashes doesn't give an error and displays, but then disappears from the screen if I sort or filter the grid.

Thanks for your help.

.....
<table width="100%"><tr><td width="50%">
<div id="mygrid_container" style="width:100%;height:30%"></div>
</td>
<td valign=top width="50%">
(...this needs to be cleaned up - waiting until changes to NetLink for load of link values...)
<div id="ordinfo">

<b>Highlight an order to see more details....</b>
</div>
<p id="whatclicked"></p>
<p id="whatgot"></p>
</td></tr>
</table>
...
...

<script>
var mygrid;
}
function doInitGrid(){

mygrid = new dhtmlXGridObject('mygrid_container');
mygrid.setImagePath("codebase/imgs/");
mygrid.setHeader("Order No,Date,Status,PO No,Salesman,Total Price");
mygrid.attachHeader("#text_filter,#text_filter,#text_filter,#text_filter,#combo_filter,#numeric_filter");
//mygrid.attachFooter("#cspan,#cspan,#cspan,#cspan,Total,${#stat_total}");
mygrid.attachFooter("-,-,-,-,Total,${#stat_total}");
mygrid.setInitWidths("*,*,60,*,80,*");
mygrid.setColAlign("left,left,center,left,center,right");
mygrid.setSkin("light");
mygrid.setColSorting("str,date,str,str,str,int");
mygrid.setColTypes("ro,ro,ro,ro,ro,price");
    mygrid.attachEvent("onRowSelect",doOnRowSelected);
    mygrid.init();

.......
Answer posted by Support on Nov 10, 2008 02:07
The issue was not reconstructed locally. We haven't got error message. The only issue is the size of grid container increases each time we sort grid.
The reason for such behaviour is that the table where grid is placed doesn't have height. Please, try to set it:

<table width="100%" height="800px"><tr><td width="50%">
<div id="mygrid_container" style="width:100%;height:30%"></div>
</td>

Using #cspan in the first cell is incorrect. Please, try to use something as follows:
mygrid.attachFooter("&nbsp;,#cspan,#cspan,#cspan,Total,${#stat_total}");