Issue #2418💬 AnsweredOpened November 17, 2019by frankpagan0 reactions

Is there an api or function to insert a value in a data-attribute in the canvas?

快速解答by artf

Hi @CoCreator-Frank I think the Trait docs page has already the answer to your questions (especially when we explain how to define a custom one). Here, for example, when you change the slider the value is passed to the component via onEvent and on onUpdate it takes the value from the component and passes it back to th...

Read full answer below ↓

Question

Hey Grapes Community! I created a custom trait select field that fetches options from our db for <a> components... when <a>(link) is clicked in canvas, component settings displays and our select field is rendered...

I am looking for a solution to pass the selected value from our custom select field to the canvas. And to get value in canvas to insert in custom select field when component is clicked in canvas.

Thanks in advance

Answers (1)

artfNovember 18, 2019

Hi @CoCreator-Frank I think the Trait docs page has already the answer to your questions (especially when we explain how to define a custom one). Here, for example, when you change the slider the value is passed to the component via onEvent and on onUpdate it takes the value from the component and passes it back to the slider

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.