Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by abrauer on Aug 05, 2008 06:44
open dhtmlx forum
dhtmlxGrid vertical scrollbar produces horizontal scrollbar

Hi,

when adding rows to the grid, the row number exceeds the available space a vertical scrollbar apears. This is good.
Bad is that also a horizontal scrollbar apears, since the vertical scrollbar consumes space from the table. Is there a way to avoid this behaviour?
To reproduce the DHTL own example can be used under dhtmlxGrid/Grid manipulations/Auto height
On the page first turn off AutoHeight and then add a row: both scrollbars apear instead of only one.

Thank you.
Answer posted by Support on Aug 05, 2008 08:15

>>Is there a way to avoid this behaviour?
You can define some column in grid as flexible ( set size as *), in such case it will automatically decrease size to compensate vertical scroll.

Alternative solution - use grid.enableAutoWidth(true)
In such case grid automatically increase its size to compensate vertical scrollbar. 

Answer posted by Support on Aug 05, 2008 08:16
If you have the same situation when both auto-height and auto-width enabled - please contact us directly at support@dhtmlx.com - this is a known issue and we can provide fix for it. 
Answer posted by abrauer on Aug 05, 2008 08:34
>> You can define some column in grid as flexible ( set size as *), in such case it will automatically decrease size to compensate vertical scroll.
>>Alternative solution - use grid.enableAutoWidth(true)
>>In such case grid automatically increase its size to compensate vertical scrollbar.

in fact I tried both things you suggested already before -- since I searched the KB before posting the question.
It didn't change anything. It would be great to have an example based on "dhtmlxGrid/Grid manipulations/Auto height"
since this comes close to the way I am using dhtmlxGrid. I am (re-)populating the grid via JavaScript instead of XML.

As about the second post: no I do not have both auto-height and auto-width enabled.
Answer posted by Support on Aug 06, 2008 03:39

Please try to add 

mygrid.setSizes();

after adding new row to the grid, if it has auto-width or flexible columns, such command will force size update and must remove unnecessary scrollbar

Answer posted by abrauer on Aug 06, 2008 07:00
Thank you, that was it.