Issue #996πŸ’¬ AnsweredOpened April 3, 2018by HarshOB1 reactions

Change attribute value that is generated through trait

Quick answerby artf❀ 1

I'd say it's enough just this

Read full answer below ↓

Question

Now, let's consider that I wrote new into the trait value but in attribute :items, I want to append prefix like item.text. to that value So, my final attribute :items become item.text.new. Is that possible?

screenshot from 2018-04-03 12-52-00

Answers (3)

artfβ€’ April 14, 2018

I'd say it's enough just this

getValueForTarget: function() {
    return 'item.text' + this.model.get('value');
  }
HarshOBβ€’ April 12, 2018

I tried creating custom trait and override a method but didn't see any attribute generated. can you please look at this code and correct me if there's any error. When I write data in traits it should generate attribute as ':text=item.text.data' at datatextfield.

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.