Issue #1424πŸ’¬ AnsweredOpened Sep 14, 2018by mararn16180 reactions

Checkbox trait value is rendered differently in view (render()) vs model (getHtml())

Quick answerby artf

@mararn1618 can you create a reproducible live demo of this issue, please?

Read full answer below ↓

Question

I have a custom component with a checkbox trait 'show-name'. When the trait value is 'true', the component renders in the view to the attribute show-name="true", whereas the model only has "show-name" and renders to "show-name" via getHtml(). How can I get a checkbox-trait to render to "show-name=true" via getHtml()? (Sorry for the long reference code below ;-) )View attribute is show-name="true" <filter-wizard data-gjs-type="Feature (Enum)" filter-model="filterDAO.getFilterForPropertyProfileId(46)" pp-id="46" pp-type="4" show-name="true" data-highlightable="1" class="gjs-comp-selected" style...

Answers (3)

artfβ€’ Sep 15, 2018

@mararn1618 can you create a reproducible live demo of this issue, please?

mararn1618β€’ Sep 16, 2018

Hi @artf, of course. I have extracted the relevant parts of my project and created a demo along with reproduction steps:Demo: https://www.secretbakery.io/grapesjs/issue1424.htmlList demo files: https://www.secretbakery.io/grapesjs/ Thanks for taking care! Edit: I have added a downloadable archive o...

mararn1618β€’ Sep 23, 2018

I am right now using a workaround for this, so that my AngularJS directive - where this attribute shall be used - recalculates 'show-name' as if we had 'show-name="true"' in the link stage.Workaround AngularJS Directive

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...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

Premium plugins ship with support, regular updates, and production-ready features β€” save days of integration work.

Browse premium plugins β†’

Related tutorials

In-depth guides on the same topic.

All tutorials β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.