-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fit columns without forcefitcolumns=true #603
Comments
Hey @jr01, I believe you are using Angular-Slickgrid so I must mention couple things in this regard.
If you're really looking at just the SlickGrid Examples (not the Angular-Slickgrid examples), then you can change the gridOptions = {
autosizeColsMode: Slick.GridAutosizeColsMode.LegacyForceFit,
// or... autosizeColsMode: 'LFF'
// ...
}; Lines 714 to 748 in 4edcca2
|
Yes, @ghiscoding I'm using your Angular-Slickgrid. But even on your demo site, without the deprecated forcefit, there appears to be no way stick the right most column to the right edge all the time. For example with the |
I'm not totally sure what you mean, can you do a print screen or an animated gif? Other things to maybe consider, in Angular-Slickgrid I enable by default the |
I created an animated gif and put in some captions to explain, but only applied them to a single frame (doh!). So here is some text to explain what I try to show The first part is with forceFitColumns on. Then I resize a single column. Initially increasing the columns size and then decreasing it. In any case the right most column's right edge sticks nicely to the right edge of the grid. That's what I want. The second part is without forceFitColumns and the new option on. The initial column resizing is superb! Then I resize the same column and you can see that the right most column's right edge doesn't stick and either a horizontal scrollbar appear, or margin. Both I don't like. Don't get me wrong here, I absolutely like the various new initial auto column sizing options and would really like to use them. It's just about resizing a single column with the mouse that I always would like to occupy exactly and no more than 100% of the container. |
The thing to note is that in Angular-Slickgrid I call
Isn't that Force Fit Column that you want? If so, and like I said in previous paragraph, just set the grid option The Example 30 should only be referenced if you want to use the new Resize by Content and once a ... so all that to say, you might just want to use |
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. I will be doing some more testing soon, I'll keep this issue in mind when I do. |
Just had an actual read of your post with the GIF - it looks like we have two different features. The new autosizing was not intended to keep the columns fitting in the viewport, it was just a one-off autosize. |
@6pac just to be clear, I built my own auto-resize by cell content (the Angular-Slickgrid Example 30) and so I'm not using yours because of many different reasons but the biggest is probably because mine will also process any Formatters defined and I also added a bunch of extra column & grid options like Also in order to be able to do my own auto-resize, I needed to expose the |
@ghiscoding good to know. yes, that was my experience too, it's really hard to separate the sizing from the controls when it's not just text. |
I was just looking at https://docs.telerik.com/devtools/winforms/controls/gridview/columns/resizing-columns-programatically and they use the term 'fill' which better describes what I would like to keep. @ghiscoding - I agree that the filling behavior is not good for many use cases. However filling is what my users are used to - it's been the only option in our Windows products for over 25 years now, so it's hard to give up on that. I guess either a fill option or not deprecating |
Entirely reasonable. For example, if you resize three columns then I suppose that you won't want any of those three to be subsequently auto-resized, so that means we have to track manually sized columns, which is something we don't do at the moment. |
We use The reason we have held back from upgrading slickgrid is not just time; 2.4.9 is the last release that did not log a message to the console about All of this is to say that I would like to echo the request from @jr01 to not deprecate I also like the word "fill" as a description of the desired behavior. IIRC, this is also the term used by gtk (https://developer.gnome.org/gtk3/stable/GtkBox.html#GtkBox--c-fill). It is contrasted with "expand" (fill causes the child to grow to fill the parent; expand causes the child to grow as the parent grows). |
Ok, so as far as I can see, the It should be possible to reproduce
I'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. |
Since I believe you use Angular-Slickgrid then I assume there is nothing left to do with this issue since the deprecation was removed in Slickgrid-Universal and So I don't think there's anything left to do here, so I'll simply close the issue. If the problem still remains then we need more info and ideally a full repro. Thanks |
Yes @ghiscoding we're on Angular-Slickgrid and good choice to close this one! |
I am confused why this issue was closed. The deprecation message is still in the 6pac repository ( Line 3636 in d1132c9
In 2021, @6pac said:
From what I can tell, that is still the case; all the |
@cout you are correct, @ghiscoding removed it in a downstream project but it has not been removed here. I'll do so and this should flow through to production in a few weeks. |
@cout the console warning was completely removed in latest v5.9.1 |
When 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 toautosizeMode=GUI
andsizeToRemaining=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
?The text was updated successfully, but these errors were encountered: