Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Jim Soho on Jun 09, 2009 02:59
open dhtmlx forum
Width of grid when using * autowidth column

I have an issue when using * autowidth column. This issue is also viewable in the sample "Autowidth for column(s)" for the dhtmlx grid. In all browsers the width given to the table.hdr and table.obj is always 3 pixels too few when a scrollbar is present to the right.

When using odd/even coloring and no border-right's for TDs this gives a slightly strange look.

Related to this: I actually do not necessarily want to use a * autowidth column. The only reason I use it is because I want the columns to fill up the entire width of the grid without ever showing a horizontal scrollbar. As I don't know if there's a vertical scrollbar or not I cannot use setInitWidths to be pixel perfect. I did try using setInitWidthsP, but there too when all the column widths I specify add up to 100% it shows 3 pixels too few when a vertical scrollbar is present. Is there another way?

Answer posted by dhxSupport on Jun 09, 2009 07:42
Unfortunately there is no way to remove 3 pixels space in the header if vertical scroll bar present in the grid. To prevent vertical scroll bar appearing you can use enableAutoHeight(mode, maxHeight, countFullHeight) method. Method has parameters:
mode - true/false
maxHeight - maximum height before scrolling appears (no limit by default)
countFullHeight - control the usage of maxHeight parameter - when set to true all grid height included in max height calculation, if false then only data part (no header) of grid included in calcualation (false by default)
Answer posted by Jim Soho on Jun 11, 2009 18:14
It is possible to remove the 3 pixel space. In dhtmlxgrid.js, in function setSizes (around line 570 for me) it says:

var scrfix = _isFF?18:18;

if I turn that into:

var scrfix = _isIE?17:15;

then it looks perfect in all browsers.


Cheers,
Jim
Answer posted by dhxSupport on Jun 12, 2009 04:48
You can make that changes. But that may have impact in the autoWidth mode.
Answer posted by Jim Soho on Jun 12, 2009 20:03
I am working with the auto width mode.

PS. It's the horizontal scrollbar that I want to avoid not the vertical scrollbar.