Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Stevo on Apr 09, 2008 01:55
open dhtmlx forum
[GRID] Expanding Row causes grid with enableAutoHeight to display scrollbar instead of expanding

Expanding Row causes grid with enableAutoHeight to display scrollbar instead of expanding

... it happens with this code. Maybe some kind of redrawing is required... can you help ?

<div id="gridbox" width="100%" height="100px" style="overflow:hidden"></div>

<script>
grid_4957 = new dhtmlXGridObject('gridbox');
grid_4957.setImagePath("codebase/imgs/");
grid_4957.enableAutoHeight(true);
grid_4957.setInitWidthsP("4,6,25,20,25,19");
grid_4957.enableResizing('false,false,false,false,false,false');
grid_4957.setHeader(" ,SO,Address,Sales name,Products,Status");
grid_4957.setColSorting('str,str,str,str,str,str');
grid_4957.setColTypes('sub_row_ajax,ro,ro,ro,ro,ro');
grid_4957.attachEvent("onRowSelect",function(id){
grid_4957._collapsMonolite();
grid_4957.cells(id,0).open();
return true;
});
grid_4957.init();
grid_4957.enableAlterCss("row_even","row_uneven");
grid_4957.loadXML("sgrid.xml");
</script>
Answer posted by Support on Apr 09, 2008 05:36
With latest version of code, the height of grid correctly changed after expanding | collapsing of sub row.
You can try to add next line to resolve issue

grid_4957.attachEvent("onRowSelect",function(id){
    grid_4957._collapsMonolite();
    grid_4957.cells(id,0).open();
    grid_4957.setSizes();
    return true;
});
Answer posted by Stevo on Apr 09, 2008 06:08
I am using build v.1.5 build 80319 and excell_sub_row I got from You yestarday (fixing safari issue with expanding rows). 
Tests are made on FF and IE7. The funny thing is it happens only if row is expanded for the first time (loaded by ajax).
Probably grid calculates the size based on that "loading" string and after content is loaded it doesn't recalculate height again.
That is why if i close this particular row and open it again, then it renders correctly.

Your solution deosn't help (probably because it is triggered too early).

Answer posted by Support on Apr 09, 2008 06:19
Issue confirmed, updated version of dhtmlxgrid_excell_sub_row.js attached
Attachments (1)
Answer posted by Stevo on Apr 09, 2008 06:26
Grr8!

It works ! What is more I've recently reported some weird behaviour in Safari (during expanding rows), that You were not able to recreate, and it is gone as well! Good job!