Hello Tony,
last time you are probably too busy because I receive no feedback from you about my last posts. Nevertheless one more bug with the corresponding fix:
I analysed some problems with wrong width calculation and found out three main reasons for that:
- The width calculation in setColWidth function has some small bugs. There are very close code in setGridWidth which works much better and some problems existing in setColWidth are fixed here.
- On all non-webkit webbrowsers the column width set to the column (from width option of colModel) will be interpret as inner witdth (without border). So if the grid has default setting shrinkToFit:true then the width value of all non-fixed colModel will be imediataly decreased even if there are enough free space for the grid. So from one side the width value of colModel to set inner width of columns, but then change the value as if one set the outer width.
- If the grid has shrinkToFit:true option, in the calculation of the shrinked column size will be used only non-hidden columns. The original column sie from the colModel definition will be ovewritten. If later one make some initially hidden column visible one recalculate the width of every column one more time. Now one use the current reduced size of initially visible columns and compared it with unchanged width of initially hidden column. In the way the proportions between columns will be distorted. I suggest at the begining to save the original value of width property of colMadel items in another property widthOrg and use always the property in the calculations of the shrinked width of columns. In the way the proportions between column widths will stay allways the same as one defined in colMadel independend on the order in which the columns will become visible.
I prepared the corresponding bug fix with changes in setColWidth , ShowHideCol and setGridWidth functions which I will post later today (about 20 lines of code should be changed).
Tony, in which form you desire that I post the changes: here or in github? If I post it in github it will be easy to make exactly this changes, but if I post my suggestions here you can easier to make some changes in the code.
OK, Tony here are my suggestions:
Changes in the function setColWidth: Line 1868:
var initwidth = 0, brd=ts.p.cellLayout, vc=0, lvc, scw=ts.p.scrollOffset,cw,hs=false,aw,tw=0,gw=0,
after the line 1872-1877