javascript - Cannot create multiple ckeditor instances ("default" is already registered) -
i have page (using kendo-ui if makes difference) has 3 text areas need made editors. problem can create 1 ckeditor instance. no matter how try create new instances, error:
uncaught exception: [ckeditor.resourcemanager.add] resource name "default" registered.
google-ing specific error message lands me 1 result doesn't tell me it.
this have tried far after searching various issues mine on stack overflow:
--deleting instances of editor if not being used /are hidden
var editor = ckeditor.instances['createtext']; if (editor) { editor.destroy(true); } $('#edittemplate').ckeditor();
--creating instances in document ready
$('#createtext').ckeditor(); $('#edittext').ckeditor(); $('#edittemplate').ckeditor();
--using class names instead of jquery spawn instances
<textarea id="edittext" class="ckeditor"></textarea>
--not using jquery , creating instances with
ckeditor.replace('createtext');
no matter cannot create more 1 editor, "the resource name "default" registered." i've tried manually remove default resourcemanager, there no
ckeditor.resourcemanager.remove
at point out of ideas, , nothing search seems address exact issue. using ckeditor version 4.4.4
thanks skobaljic able determine problem came from. in config.js had block:
ckeditor.stylesset.add('default', [ // block styles { name: 'subtitle', element: 'h3', styles: { 'color': '#aaa', 'font-style': 'italic' } }, // object styles { name: 'small', element: 'font', attributes: { size: 3 } } ]);
commenting block out editors work expected. think in order add styles each editor instance i'll have use separate config files or something, goes out of scope question.
Comments
Post a Comment