-
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
dynamically resize grids #3031
Comments
This looks to work quite well - so would probably be useful for other people. The standard answer to sizing issues on initial rendering is to call handleWindowResize(). Refer: http://plnkr.co/edit/FsVsjGn883eUMnrMjewX?p=preview. It'd be nice to have this cleaned up into a feature if possible - perhaps added to the auto-resize feature? |
Thank you so much, works nicely. How do you envision to integrate that into ng-grid? Having a directive that takes a reference selector and some calculation and than sets the height of the grid according to that? That would basically be the opposite direction of what I did (setting a directive on a reference element and adjusting the grid's height according to that). |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed because it has not had recent activity. If you believe that this is still an issue in the latest version, feel free to re-open it. Thank you for your contributions. |
Note: add good first issue label |
I have found a temporary solution for my implementation of the ui-grid
Every time data in the ui-grid changes I update the css height for the ui-grid-viewport class to (number of rows * 30) note* I found adding an extra 15 pixels works nicely with chome and firefox scroll bars Any update on an official solution to this issue? |
I want a grid to have a height relative to the window. For that I wrote a little directive which works in principle. When I resize the browser, the grid height changes smoothly.
The problem is the initial rendering without resizing the browser: the grid is resized correctly, but the ui-grid-render-container is not.
I've prepared a plunk demonstrating my issue: http://plnkr.co/edit/1XJY8wlamohk25yec5Sm?p=preview (In defense, the directive and HTML structure are a little simplified, but the effect is the same. The ng-if="1" simulates ui-views.)
There are two "switches" which affect the behavior: The $timeout in the directive and the ng-if="1" on the div surrounding the grid. The following happens:
Without ng-if="1" and without $timeout everything works fine.
Without ng-if="1" and with $timeout the grid resized, but not the render-container.
With ng-if="1" and without $timeout nothing is resized.
With ng-if="1" and with $timeout the grid resized, but not the render-container.
Sadly, I cannot get rid of ng-if="1" or rather its equivalent ui-view.
Is there anything in the directive/structure I can do to solve this or can this be fixed inside ui-grid? It seems strange that the grid and rendering container can be of different size.
The text was updated successfully, but these errors were encountered: