-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Internal grid rendering uses different height than overall outline #2023
Comments
We have some outstanding questions and documentation that we need to do around the various refresh and redraw methods, and which of them do what. Refer #1818 |
@PaulL1 that would be great if there's some method that can be called to force the table to recalculate its parameters. As I show above, the table outline itself gets it right, but then the internals don't. I've tried every call I could find documented, but nothing fixes it. Of course, even better would be a fix to this behavior! |
Turns out that calling |
handleWindowResize is a subset of redraw, the other option is |
Thanks, Paul. Further investigation reveals that the root of this problem lies in placing the grid in a FWIW, it seems that you almost don't need it. If someone ever wants to deal with this, here are some clues:
Leaving enough blank space below the table to accommodate the materialization of the hidden div avoids the introduction of the scrollbar, and the table remains OK (other than breaking out of the bottom). But of course, this is not always practical or an efficient use of space. Anyhow, I hope this is helpful, and I can either choose to take the performance and redrawing ugliness of ui-grid-auto-resize, or skip the hidden divs. |
Thinking out-loud: |
This is a useful request, but not really in the current roadmap. We have far too many good ideas in the repository already, giving the impression that we have a project riven with defects. Accordingly, I am leaving the enhancement tag on this, but closing it. If someone would like this functionality, we'd welcome a pull request that adds it. |
When using flex-grow to ensure that the grid takes 100% of the height available, it correctly shows its outline, but then draws its internals as if the height available had been calculated with every hidden div on the page actually shown. The result is that the footer gets drawn in the middle of the table, raised by the vertical amount of any hidden div.
If you resize the window, everything then draws correctly. It's just the initial setup that is incorrect. Unfortunately, calling gridApi.handleWindowResize() or gridApi.refresh() does nothing, probably because it detects that the window hasn't actually changed size.
Here's a plunker showing these flex-grow problems with ui-grid. It uses a slightly modified form of the code from ui-grid tutorial 101. By clicking the "Toggle Hidden" button, you can see that when the hidden div is shown, the table draws properly. Well, it would, except someone just published on the unstable branch a problem with the bottom scrollbar getting drawn a bit too high, but I assume that will be resolved shortly.
I could imagine that it might be tricky to fix this, but sure would appreciate a workaround, or even a call that would actually force the grid to redraw.
The text was updated successfully, but these errors were encountered: