Script interpolation for object [QUESTION]
@Ramkumar-Murugesan objects/arrays are not supported yet, we'll add them in the next release. For now, if you need an object/array in the script, create another property with a JSON.stringify version of the original (set a listener on original to update the stringified one)
Read full answer below βQuestion
Hi guys, has I know that we use external string values in script function by assigning the variable with value in custom triats. but I tried to pass the object or array. I didn't get the correct values. i really stuck on it can anyone please help me. my traits:- screenshots in the above screenshot. myModelCount value are printed but the myModelPropName value is shows [object, object] inside of script function.
Answers (1)
@Ramkumar-Murugesan objects/arrays are not supported yet, we'll add them in the next release. For now, if you need an object/array in the script, create another property with a JSON.stringify version of the original (set a listener on original to update the stringified one)
Related Questions and Answers
Continue research with similar issue discussions.
Issue #445
Calling a function which is outside the component same as explained in issue #395
I am calling a function which is outside the component same as explained in issue #395 but it is returning a string instead of a function I...
Issue #2194
CKEditor blocks is not editable[QUESTION]
Hi guys, I added the custom CKEditor blocks and its working fine. but the actual issues is I can't able to delete, move or add the traits i...
Issue #3257
Block.get('category') returns different results in Chrome and Firefox
Hello, I've hit weird bug when I tried to get block category. block.get('category') returns object in Chrome, but in Firefox the same code...
Issue #3238
How to load external javascript,i tried all methods,Useless
I write html strings as blocks, and need to introduce a lot of external scripts and styles, but I tried all the methods, when I drag the bl...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins β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.
Tutorial
Messaging on gjs.market: talk to a studio before you buy, not after
We've launched private messaging between buyers and studios. One thread per buyerβstudio pair, the whole history in one place.
Tutorial
Lighthouse for GrapesJS: Audit Accessibility and SEO Without Leaving the Editor
Live WCAG 2.1/2.2 accessibility auditor + SEO manager for GrapesJS. Every finding is bound to the exact component β click to select, then one-click fix.
Tutorial
GrapesJS DevTools: A Developer Panel Inside Your Editor
If you've ever debugged GrapesJS with console.log(editor.getSelected()) and a dozen throwaway event listeners β this post is for you.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.