[Need help]: After using urlLoad from storage manager impossible to change component with Traits
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';
});
}
});
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
Ok. Thank you. Will wait update
Still some part of bug present. It seems inside of script: function () traits will have old value.
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.