[Need help]: After using urlLoad from storage manager impossible to change component with Traits
Question
Hello, I am save template to db and after loading from db impossible to change component with Traits. Video example on countdown: https://youtu.be/0QPKswfhzlU version: "0.13.8"
let editor = grapesjs.init({
height: '100%',
fromElement: 1,
showOffsets: 1,
container: '#gjs',
plugins: ['gjs-blocks-basic', 'gjs-component-countdown', 'gjs-navbar', 'evp-video','gjs-blocks-flexbox', 'gjs-preset-webpage', 'add-popup'],
storageManager: {
autosave: false,
setStepsBeforeSave: 1,
type: 'remote',
urlStore: '/7min-admin-panel/pb_page.php?id=' + id + '&action=save',
urlLoad: loadUrl,
contentTypeJson: true
},
canvas: {
}
});
editor.Panels.addButton
('options',
[{
id: 'go-back',
className: 'fa fa-reply',
command: 'go-back',
attributes: {title: 'Go back'}
}]
);
editor.Panels.addButton
('options',
[{
id: 'save-db',
className: 'fa fa-floppy-o',
command: 'save-db',
attributes: {title: 'Save DB'}
}]
);
// Add the command
editor.Commands.add
('save-db',
{
run: function (editor, sender) {
sender && sender.set('active'); // turn off the button
editor.store();
editor.on('storage:end', function (e) {
alert('Success saved');
window.location.href = '/7min-admin-panel/pb_list.php';
});
}
});
Answers (3)
I updated to "0.14.5" and still have issue. I am trying to debug and found next, traits always return old value which was selected before saving .
Can someone help me on what place start to investigation issue?
Thanks for the catch @v8jupiter it was actually an issue with the component javascript loading. I'll publish the fix with the next release
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1092
[BUG]traits and storage trigger
Hey, maybe it's not bug, i'm not sure. I have traits with changeProp: true field. When I change the value of trait by UI, model is changed...
Issue #1985
[BUG] Autosave with remote storage doesn't send network requests
OS: Windows 10 Browser: Chrome 73 GrapesJS version: 0.14.57 I have remote storage configured using this call to grapesjs.init(): While I se...
Issue #998
[BUG] Asset Manager sends empty request when uploading image
Description: GrapesJS editor is initialized in an editor.html file as follows: localhost:9001 is a local IIS server running PHP5. The conte...
Issue #1429
Empty content when load from remote storage if components array is not empty
I have problem loading stored remote content into the editor when the JSON contains non empty gjs-components My JSON data looks like this 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.