Issue #873Opened February 15, 2018by v8jupiter0 reactions

[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)

v8jupiterFebruary 15, 20180 reactions

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 .

v8jupiterFebruary 16, 20180 reactions

Can someone help me on what place start to investigation issue?

artfFebruary 27, 20180 reactions

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.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.