Issue #1146Opened May 30, 2018by sura2k1 reactions

Adding traits to wrapper

Question

I found a way to add traits to wrapper via init function,

domComponents: {
	wrapper: {
            emovable: false,
	    copyable: false,
	    draggable: false,
            traits: [...]
        }
}

But I had to add other wrapper configs such as emovable, copyable, etc. Since wrapper is only a config element I hope this is the default behavior. However if there is a way to just add traits[] without other properties, how it could be done?

Also I did following. DomComponents.getWrapper().get('traits').add({'name':'test', 'type': 'text', 'label':'Test'})

When I click on wrapper element, I get following error message. image

Anyway I'm going to go with the config setting, the first one I described. If there is a better way of doing it, please give me some information.

Thanks.

Answers (3)

artfMay 31, 20181 reactions

But I had to add other wrapper configs such as emovable, copyable, etc. Since wrapper is only a config element I hope this is the default behavior. However if there is a way to just add traits[] without other properties, how it could be done?

If you do it via init config, this is the way and you have to specify all other properties if you need them.

Also I did following. DomComponents.getWrapper().get('traits').add({'name':'test', 'type': 'text', 'label':'Test'}) When I click on wrapper element, I get following error message.

Just tried the same code on the demo and it worked as expected (try to update to the latest version)

sura2kMay 31, 20180 reactions

I was using 0.14.5. It is working nicely with 0.14.15. Thanks for the tip and sorry to bother without testing it against latest version.

betacarNovember 24, 20180 reactions

@sura2k How did you extracted the wrapper's trait values after they're set? /cc. @artf

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

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.