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

grid.save() and page refresh. Original configuration is lost if save is called in oneColumnMode #1849

Closed
andrea-spotsoftware opened this issue Sep 13, 2021 · 1 comment · Fixed by #1875

Comments

@andrea-spotsoftware
Copy link

andrea-spotsoftware commented Sep 13, 2021

Subject of the issue

When calling grid.save() in oneColumn mode, for example after grid change, original widgets configuration is not exposed in the resulting JSON config.
We store this config in localStorage.
Then, after restoring the grid in a different session (reloading the page) , loading config from storage, there is no way to deduce the original config, every widget has w = 1 and is misplaced.

Your environment

  • 4.2.5 HTML
  • chrome/win

Expected behavior

The save method should generate a config that can help the grid to reload correctly.

Actual behavior

Calling save in oneColumn mode and storing the result, is resulting in a wrong original widget configuration if loading from localStorage in a following page reload.

adumesny added a commit to adumesny/gridstack.js that referenced this issue Oct 16, 2021
fix gridstack#1849 gridstack#1816
* always save the layout with the highest resolution no matter what current column count is (eg: 12 when in 1 column mode)
to make sure we keep full resolution on restore.
adumesny added a commit to adumesny/gridstack.js that referenced this issue Oct 16, 2021
fix gridstack#1849 gridstack#1816
* always save the layout with the highest resolution no matter what
current column count is (eg: 12 when in 1 column mode)
to make sure we keep full resolution on restore.
@adumesny
Copy link
Member

fixed in next release. don't forget to donate if you find this lib useful!

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 a pull request may close this issue.

2 participants