Grid with subGrid - problem with scrollbars - sample include


Horizontal scroll bar appears when not needed (grid sizes should be recalculated)

Steps to reproduce:

Basing on sample file:


change div parameters to:

change grid script to:

mygrid = new dhtmlXGridObject(‘gridbox’);


    mygrid.setHeader(“A,B,ed,Price,In Store,Shipping,Bestseller,Date of Publication”);








After loading the page (IE 7) try to expand last row “Alice in Wonderland” unwanted horizontal bar will appear;

My suggested solution:

In file dhtmlx_excell_sub_row.js:





NOTICE that adding:








WILL NOT fix the problem because this event occures before data render in grid

This is expected behaviour. Expended sub grid cannot increase width of the parent grid. You can try dhtmlxTreeGrid which has better parent-child functionality. Please see more information here … ndex.shtml

Im not understanding this way of thinking, the horizontal bar that shows up is completely unnecessary and broke view of whole grid.
Why not fix this in standard?
Did I miss something?

The top level grid renders independently from content in sub-elements. The sizes of top level grid defined by widths of columns ( provided during init ) and will not size to anything other without direct js command.

>> mygrid.enableAutoWidth(true);
This settings means that width of the grid will be equal to the sum of column’s width, it will not force any other auto-size behavior.

When you are using sub-grids created in default way ( without customization ) - they will have scrollbars disabled - so no any additional horizontal scrollbar will appear

This problem is not related to enableAutoWidth, if you set with to sum of cell widths then this problem occurs even when disabled auto width.

Sample file attached (2.94 KB)

Problem with not auto-adjusted width , in case of enableAutoWidth used - confirmed, for now it can be workarounded without code modification as

mygrid.attachEvent(“onSubRowOpen”,function(){ //dhtmlxgrid 2.1+

>>even when disabled auto width.
With disabled auto-width the current behavior is expected one, after expanding row - height of grid data increased, so vertical scroll occurs, and to show it without grid size changes - horizontal scroll occurs as well.

Provided solution works, and I agree with this conclusion.