How to render component in canvas using trait.
Question
Hi Artf ,Thanks for your great tool,I have created test case for my problem
https://js.do/code/271771
I have created custom tool sidebar and create trait to render component with checkbox updates.
-To reproduce 1-drag sidebar component into canvas (it should print initial fname value in console) 2-open filter menu in classes style manager 3-check checkbox select fname 4-Then I want to render sidebar component in canvas with fname value 5-I would use this value as parameter to use in script after publish the page.
Answers (3)
In your doStuff method you're only getting the name of the trait, so nothing useful. I think if you change that checkbox trait in a simple input, you'll see the script changing correctly in the export code
Thanks for your replay, Could you please explain more what should I do?What do you mean by ( change that checkbox trait in a simple input)? I have updated demo to be more clear https://js.do/alialrabi/273238 . There are two checkbox fname and lname ,So need to change the value of myModelPropName to fname or lname ,what ever user select. I set myvalue in dostuff method by myvalue = trait.get('name') ,So myModelPropName value should changed ,but the script still not updated .
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.
Issue #1208
Create minimalist Panel left sidebar III
hello @artf , thanks to you for the comment on #1188, i see in the code https://codepen.io/artf/full/MQpZPj/ uses the appendTo property to...
Issue #1674
Render block after trait action .
I have created new block called sidebar that have dynamic updates by trait component ,trait contain checkboxes to dynamic change content by...
Issue #1931
[Question]: How to insert image inside the link?
Hi @artf , How can I insert image inside the link? Please share your ideas what I need to do. If I need to create any custom component, ple...
Issue #1227
Re-render view in editor's canvas whenever Trait value changes
Is there any possible way in grapesjs that whenever a user changes the value of a Trait of a custom component the render function should li...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.