Local2 example for storage not working
Seems I have to manually call before the return result above. That's not in the example code. Is that correct? Seems strange to me, what about the other elements, gjs-styles and gjs-assets? Are they not needed?
Read full answer below βQuestion
Using code provided in docs. https://github.com/artf/grapesjs/wiki/API-Storage-Manager in "add" examples. I am trying to create my own storage method. The "store" method works fine, and it adds the content to the localStorage. I can inspect it and see in Applications of chrome devtools. With autoload: false, refreshing the page shows an empty html body which is what you'd expect. Clicking on a button I have that calls the "load" method runs but does not update the editor. (from the docs directly) This was added by calling... and I call it by running... This code runs and I see the keys and th...
Answers (3)
Seems I have to manually call before the return result above. That's not in the example code. Is that correct? Seems strange to me, what about the other elements, gjs-styles and gjs-assets? Are they not needed?
Hi Enric, actually the wiki is not updated with the new signature, you have to call the callback
store(data, clb) {
... async store
clb(resultObject);
...
},
load(keys, clb) {
... async load
clb(resultObject);
...
}
thanks for pointing this out
Thanks, will give that a shot later!
Related Questions and Answers
Continue research with similar issue discussions.
Issue #792
Script property using function don't work with blocks
In Components & JS docs there's this example: This works perfectly. But I couldn't use a function instead of a string in script, as is said...
Issue #1113
New trait type is not working with rendered components?
Hello, thanks for the great framework. I'm trying to apply this to my project. I want to add a new trait for existing LINK '<a>' component....
Issue #361
Getproperty style manager not working
https://github.com/artf/grapesjs/wiki/API-Style-Manager#getproperty
Issue #581
Reading component related events
The Editor API wiki lists a set of component-related events that can be listened to (e.g. component:add, component:update). There is howeve...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins βPremium plugins ship with support, regular updates, and production-ready features β save days of integration work.
Browse premium plugins βRelated tutorials
In-depth guides on the same topic.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.