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.
>>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.
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.
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.
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
Thank you, that was it.