Skip to content

fix(core): Fix columns reverting back to original size after restoring #4717

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

Merged
merged 4 commits into from
Jan 19, 2016

Conversation

hahn-kev
Copy link
Contributor

There's currently an issue with the grid related to hiding columns and restoring saved column widths.
Here's a Plunker that shows the issue http://plnkr.co/edit/u1BHqBowywYhDhvnfc5R?p=preview

  1. setup a grid with resizable columns and enableGridMenu = true, and saving and restoring the column widths from local storage
  2. adjust the width of a column (make it big enough so you will notice the change when it reverts back)
  3. save the grid state to local storage
  4. refresh the page
  5. restore the grid state
  6. hide a column using the grid menu
    once the column is hidden you will see that the column you resized will revert to it's original size. The cause is when column visibility is changed updateColumnDef is called which updates to column width from the columnDef if the column does not have a customWidth (indicated by the hasCustomWidth property) so in order to resolve the issue when restoring the column state we also set hasCustomWidth to true when the widths are different.

@patrickdet
Copy link

@hahn-kev thank you for this! that issue was driving me crazy and had customers complaining a lot

@JLLeitschuh
Copy link
Contributor

Looks good to me too. If no one protests, I'm going to merge this in tonight.

@hahn-kev
Copy link
Contributor Author

@JLLeitschuh How's it looking for the merge? is there something wrong with it?

@swalters swalters changed the title Fix columns reverting back to original size after restoring fix(core): Fix columns reverting back to original size after restoring Jan 19, 2016
swalters added a commit that referenced this pull request Jan 19, 2016
fix(core): Fix columns reverting back to original size after restoring
@swalters swalters merged commit cecb7eb into angular-ui:master Jan 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants