-
Notifications
You must be signed in to change notification settings - Fork 427
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
fix: adjust the left/right canvas width properly when fullWidthRows is used #664
fix: adjust the left/right canvas width properly when fullWidthRows is used #664
Conversation
ec50cc8
to
ae7e1cb
Compare
@xinchao-zhang |
@ghiscoding I've updated my original comment with screenshots |
ok that's much better to understand, but I wonder why do you think it's better with the fix and what is your use case? |
This renders the data grid in a way more similar to e.g. Excel. In my view it just makes the grid looks more polished. We don't always have the luxury/flexibility to shrink the viewport in order to get rid of the white space. E.g. the grid might be only a part of a larger layout and the size of the grid viewport is decided externally and dynamically (think flexbox). Meanwhile the column set can change dynamically as well (e.g. user can add or remove or resize the columns at runtime) so it is hard to always statically fix the viewport size. But most importantly, what does |
oh right I forgot you mention that it's with the |
Wasn't aware it even existed! |
This looks good to me. OK to proceed @ghiscoding ? |
I'd be ok with it |
When
fullWidthRows: true
is used in options, and when the viewport width is larger than the canvas width, slick grid does not create rows wide enough to fill the viewport.This happens because although the total canvas width has been calculated to match that of viewport, the total canvas width is not distributed to the left/right canvas.
To illustrate:
Without the fix and with this option:

{ fullWidthRows: true }
, there is an area of white space at the right side of the canvas (selected row is colored in blue to make it more obvious):And with this option:

{ fullWidthRows: true, frozenColumn: 2 }
:Basically visually the fullWidthRows has no effect.
With the fix and with this option:


{ fullWidthRows: true }
:Same for frozen columns
{ fullWidthRows: true, frozenColumn: 2 }
: