Issue #1869💬 AnsweredOpened March 7, 2019by Ramkumar-Murugesan0 reactions

How to add extra field in input traits

Quick answerby arthuralmeidap

In the docs, there is exactly an explanation about what you are looking for. Take a look here: https://grapesjs.com/docs/modules/Traits.html#add-traits-to-components

Read full answer below ↓

Question

Hi, I want to add the new field in default input traits. for example:- i need to add {label: binding, name:binding} in already exist input traits

image

in the above image. i need to add the new field in between of name and placeholder.

can anyone please help me

Thanks in Advance

Answers (3)

Ramkumar-MurugesanMarch 8, 2019

I did this by using

 this.editor.DomComponents.getType('input').model
            .prototype.defaults.traits.push({
                type: 'text',
                label: binding,
                name:binding

            });

and its working fine

lock[bot]March 10, 2020

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

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.