Issue #1977Opened April 25, 2019by Ramkumar-Murugesan0 reactions

[QUESTION] gjs-component is not updated with my traits values

Question

Hi, have I modified my HTML using the toHTML function in traits. An HTML element is updated but the gjs-component is not updated still it shows the old code.

my traits are

 toHTML: function () {
          const html = this.view.el.innerHTML;
          const name = this.get('traits').where({ name: 'name' })[0].get('value');
          const value = this.get('traits').where({ name: 'value' })[0].get('value');
          let renderHtml = `<input type="radio" `;
          if (name) {
            renderHtml += ` name="${name}" `;
          }
          if (value) {
            renderHtml += ` value="${value}" `;
          }
          renderHtml += `class="radio"/>`;
          return renderHtml;
        }

but its shows older code like type="radio" is not stored in gjs-component after i loaded my saved screens

before saving the screen

image

after saved and load into grapesjs using

editor.setComponents(JSON.parse(existScreenDetail[0]['gjs-components']));

but its

image

can any please help me.

Answers (2)

artfMay 1, 20190 reactions

I barely understand you here... please provide a reproducible demo

lock[bot]May 6, 20200 reactions

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.

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.