Skip to content
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 #5090 introduce gridDimensionChanged event #5094

Closed
wants to merge 1 commit into from
Closed

fix #5090 introduce gridDimensionChanged event #5094

wants to merge 1 commit into from

Conversation

dlgski
Copy link
Contributor

@dlgski dlgski commented Feb 10, 2016

The grid menu enables a scrollbar to keep it's height under the height of the grid by 30px. However, it is only calculated when created. If auto-resize is on then the grid menu height does not get updated and therefore may get cut off. This PR adds a new event gridDimensionChanged to the gridApi which the menu can watch for to update it's style on change.

@@ -41,6 +41,7 @@
if (newGridHeight !== prevGridHeight || newGridWidth !== prevGridWidth) {
uiGridCtrl.grid.gridHeight = newGridHeight;
uiGridCtrl.grid.gridWidth = newGridWidth;
uiGridCtrl.grid.api.core.raise.gridHeightChanged(prevGridHeight, newGridHeight);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be raised even if the gridWidth was the only thing that changed. I'd like to see a check here to only raise for height changes.

OR, you could change to gridDimensionChanged(prevGridHeight, newGridHeight, prevGridWidth, newGridWidth). I like that even better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gridDimensionChanged does not exist already, correct? I should just update the event I made here with this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, I would just update the event name.

Are there other ways a gridDimension can get changed? We need to make sure we raise the event everywhere it can occur.

@dlgski dlgski changed the title fix 5098 introduce gridHeightChanged event fix #5090 introduce gridHeightChanged event Feb 10, 2016
@dlgski dlgski changed the title fix #5090 introduce gridHeightChanged event fix #5090 introduce gridDimensionChanged event Feb 11, 2016
@dlgski
Copy link
Contributor Author

dlgski commented Feb 11, 2016

@swalters good idea on gridDimensionChanged. This has been updated.

@swalters
Copy link
Contributor

#5107

@swalters swalters closed this Feb 16, 2016
@dlgski dlgski deleted the gridHeightChanged branch December 6, 2016 20:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants