[Feature] Pass store manager's response to editor's store callback
Question
Hi @artf, We have a need to get a response of the store manager when calling editor.store() method with a callback (we return generated template id in this case from the server). I'm pretty sure you have it implemented for editor.load() method. I think the change is pretty simple in /src/editor/model/Editor.js
/**
* Store data to the current storage
* @param {Function} clb Callback function
* @return {Object} Stored data
* @private
*/
store(clb) {
...
sm.store(store, (res) => {
clb && clb(res);
this.set('changesCount', 0);
this.trigger('storage:store', store);
});
...
},
Let me know if you want me to do a pull request. Thank you.
Answers (2)
Hi @artf, I created a pull request for this issue - https://github.com/artf/grapesjs/pull/881. Tested locally - works as expected.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #849
Ability to unload and destroy the editor instance or reload the config options?
In my use case, I'm trying to change the store and load URLs used by the remote storage manager dynamically. As far as I can tell, the edit...
Issue #2073
[QUESTIONS] Trouble using urlLoad
I've got an issue calling to my endpoint to load a template, it's doing a pre flight OPTIONS request but I cant find how to continue after...
Issue #1956
[QUESTIONS] How to pass params when make editor.load()
Hi, use the last version everything works perfectly. I use remote storage but need to pass custom params with settings when make load reque...
Issue #1059
[Question]: Load html content from a file dynamically
Hi, I need to load content from a html file from server onto editor after or while initializing editor. How this can be implemented? HTML w...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.