-
Notifications
You must be signed in to change notification settings - Fork 426
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
resizeCanvas() does not take into account the preHeader height #493
Comments
Can you try to modify the function resizeCanvas() {
if (!initialized) { return; }
paneTopH = 0;
paneBottomH = 0;
viewportTopH = 0;
viewportBottomH = 0;
+ var preHeaderHeight = options.showPreHeaderPanel ? options.preHeaderPanelHeight : 0;
//-- ... code removed for brevity --//
// The top pane includes the top panel and the header row
+ paneTopH += topPanelH + preHeaderHeight + headerRowH + footerRowH;
if (hasFrozenColumns() && options.autoHeight) {
paneTopH += scrollbarDimensions.height;
}
// The top viewport does not contain the top panel or header row
+ viewportTopH = paneTopH - topPanelH - preHeaderHeight - headerRowH - footerRowH; EDIT Actually I tried with the Auto-Resize Example by adding a blank pre-header, and I think it works with these changes. It would be nice if you can confirm on your side before merging PR #497 with the fix. |
I had to make a minor mod for it to work correctly in my scenario (inside a flex grow column height 100%): The viewportTopH does no need to include the preHeaderHeight. Also made a change to take into account the showPreHeaderPanel value.
|
Great thanks for the confirmation, I updated the PR #497 and tested locally too with the auto-resize example, removing that last line doesn't have any impact. Again thanks for confirming. |
@xavier-90 New behavior When I put back the calculation that I wrote earlier, it fixes my issue // The top viewport does not contain the top panel or header row
+ viewportTopH = paneTopH - topPanelH - preHeaderHeight - headerRowH - footerRowH; After that the grid resize is correct
EDIT Actually after investigating a bit further, the PR I made with the code change is completely invalid. So to go back to your original question, it most probably is an issue in your own code, not in the SlickGrid itself. I will rollback PR PR #497, that was a bad code change from my side. |
I have done further tests and found that I was actually “barking at the wrong tree”. The issue is with the resizer: If setting the resizer bottom padding to 0 then the grid is rendered with a bottom padding of 20px (the default). |
ok let's close this issue, the rollback PR was merged, let's discuss it further in the other issue #504 |
I have created a grid with the wollowing options:
On calling resizeCanavas(), e.g.
the height of the grid is reduced by 25px.
The text was updated successfully, but these errors were encountered: