-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
How to store layout content as well using save()
method?
#1418
Comments
no, I did not store the html content as that may be very app specific. saving the html might not work and be sufficient for some app (like my angular based app) that is why I save the id (and all other attributes) so app can fill in their custom content as well. |
Ok great. Yes you could give an optional parameter to |
don't forget to contribute $ or time to help this lib! since you are Ray$$$ :) |
@adumesny haha sure mate! |
fix for gridstack#1418 * `save(saveContent = true)` now lets you optionally save the HTML content in the node property, with load() restoring it * `addWidget(opt)` now handles just passing a `GridStackWidget` which creates the default divs, simplifying your code. Old API still supported. * fixed all demos and test case to use newer API
will be in next release... |
fix for gridstack#1418 * `save(saveContent = true)` now lets you optionally save the HTML content in the node property, with load() restoring it * `addWidget(opt)` now handles just passing a `GridStackWidget` which creates the default divs, simplifying your code. Old API still supported. * fixed all demos and test case to use newer API
I am using gridstack.js v2.0 and trying to build a dashboard. I have posted a part of my html below
I am able to render it properly and
drag
andresize
works just fine. Now I need tosave
andload
the layout and so I use local storage. This is what I doTo load, it's as simple as
But when I print the output of the serialised data, this is how it looks like
What I observed is that it doesn't store the content of grid items. In earlier version, one could do something like this
Here one could store the content and retrieve it later. But from v2.0 onwards
gridstackjs
has providedsave()
andload()
functionalities that do way with writing these extra lines of code and the subsequentjquery
dependency. However it doesn't store the layout content anymore. Is there any way to store the content as well? Or am I missing out something?The text was updated successfully, but these errors were encountered: