Issue #1930Opened March 28, 2019by rikoyudiansyah10 reactions

[QUESTIONS] change 2 attributes with 1 trait

Question

I have an input trait, I want to change the 2 attributes (name and type) on the selected input element, on canvas is appropriate, but in the final html(editor.getHtml()) it doesn't work, I've read https://grapesjs.com/docs/modules/Components.html#define-new-component but I didn't find a solution, Thank's Screenshot_2

Answers (2)

artfMarch 30, 20190 reactions

You should change the model and not the view element this.model.setAttributes({ 'data-attr': 'value' })

lock[bot]April 2, 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.