Fit columns without forcefitcolumns=true
See original GitHub issueWhen resizing a column and forceFitColumns=true
all columns always stick to the viewport 100%. The right most column’s right border sticks to the viewport right border and a horizontal scrollbar is never shown. When resizing a single column the next column grows/shrinks until it’s max/minwidth and then the next column etc.
forceFitColumns
is deprecated and we get a console.log message now: forceFitColumns option is deprecated - use autosizeColsMode.
Having read https://github.com/6pac/SlickGrid/wiki/Auto-Column-Sizing my expectation is that I could get a similar sticky fitting behavior with autosizeColsMode=FitColsToViewport
and all columns set to autosizeMode=GUI
and sizeToRemaining=true
.
But when I resize a column with those options and also with any other combo of settings I tried, the right border of the right column never sticks to the right border of the viewport: either a horizontal scrollbar appears, or there is margin.
I tried this with http://6pac.github.io/SlickGrid/examples/example-size-to-content.html and in my application.
Perhaps I’m missing some setting. How can I get the (old) sticky/fitting behavior with autosizeColsMode
?
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (5 by maintainers)
Top GitHub Comments
Thanks for taking this one up, @ghiscoding!
Just should say that I put the new autosizing feature in a while back, but I have found it still quite difficult to get good results with it on ‘Auto’ mode. It’s not that there’s anything wrong - it’s just a quite hard problem. I think I need to go back and do some more tweaking.
So I’d say, don’t be afraid to use the legacy mode if that works better for you.
I will be doing some more testing soon, I’ll keep this issue in mind when I do.
Ok, so as far as I can see, the
forceFitColumns
code has not actually been touched - it’s still there and still works, up to the current version. I think the easiest solution is simply for me to remove the message.It should be possible to reproduce
forceFitColumns
behaviour withI’ll go over and check the interactions to make sure this is the case, and revisit the ForceFit behaviour in the new mode. That should take us into the future.