Can we set a class to wrapper
Question
Hello ,
As per the document , // Change background of the wrapper and set some attribute var wrapper = domComponents.getWrapper(); wrapper.set('style', {'background-color': 'red'}); wrapper.set('attributes', {'title': 'Hello!'});
Can we set a class to wrapper.
Please let us know how to set a class to the root component i.e. wrapper.
Thanks.
Answers (3)
Sure editor.DomComponents.getWrapper().addClass('wrapper')
@artf , Thanks for the reply.
Can we do editor.DomComponents.getWrapper().addClass('wrapper')
in the release 0.10.7
Thanks.
Sorry to bother you,
Because when i tried in version 0.10.7 it is giving a error [Error] TypeError: wrapper.addClass is not a function. (In 'wrapper.addClass('wrapper')', 'wrapper.addClass' is undefined) Global Code (index.html:4474) And one more request , i do not want to update to latest release, so can you tellme , any possible way to achieve this.
Thanks.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #519
No Blocks by default
Using this code I get an editor but there are no blocks. I also do not get the icons for the screen size but other icons are there. As you...
Issue #1169
[Question] Get and set some styles to active element (in components)
Is it possible to have some style attributes, for example, color, background-color, font-size, in component settings tab, together with tra...
Issue #493
[QUESTION] Can i set content dynamically from block API ?
Hi @artf , very great web builder framework and keep it up :+1: code : As you can see, can i make tag dynamically from my backend? i use EJ...
Issue #689
Change value of attribute that is passed through traits
Hello @artf Is there any methods to manipulate the input value of an attribute that is passed through traits. Like I passed value Hello in...
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.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.