Issue #2405Opened November 13, 2019by fmr4110 reactions

[QUESTIONS] ckeditor is not initialized when replace trait text

Question

Code SnippetTEXT
why when i change the ckeditor trait text it is not initialized
my trait
<pre>
domComps.addType('text',{
		model: dModel.extend({
		  defaults: Object.assign({}, dModel.prototype.defaults, {
			traits: [
			 {label:"Font Size", type:"text_fontsize"} 
			  ],
		  }),
		},
		{
		  isComponent: function(el) {
			 if (el.getAttribute && "text" == el.getAttribute("data-gjs-type")) return {type: "text"}
		  },
		}),
		view: dView,
	});
</pre>

there is no ckeditor class in the component
![Screenshot_3](https://user-images.githubusercontent.com/15244481/68734062-7bd22d00-060b-11ea-962d-86366acad007.png)

Answers (3)

artfNovember 16, 20190 reactions

As you're still using the old API definition (which is quite an error-prone) I recommend reading first the documentation about Component then probably you'll find the issue

fmr411November 18, 20190 reactions

or is there another way to add trait (for text) so that ckeditor can work

artfNovember 19, 20190 reactions

In the documentation you can see how to extend other components

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.