开发者

Multiple CKEDITOR instances with different config files in IE broken

I'm trying to place multiple CKEDITOR instances on the same page, each one loading a different config file. It works fine in FF, but in IE the config file from the last instance on the page is applied to all instances. Each instance has a unique base element name. I'm using the following code to add the instances, with the customConfig, width, and height values changing for each instance.

CKEDITOR.replace(   document.form1.elementName,
                                {
                                    customConfig : customConfigFile.js',
                                    width :   '500px',
                                    height: '200px'
                                }
);

What am I doing wrong? I can't just specify the settings from the config files on the page, because part of the config file is an oninstanceready call. The on开发者_如何学Cly way I've been able to make it work is to delay the initialization of each instance using setTimeout, but this is far from ideal. Any ideas?


Try putting it at the bottom of your page after the closing body tag becuse the element has to be loaded before the replace can happen. And you only need the name of the config file not the full path as has been suggested in other forums. I had the same issue and that worked for me. Don't forget you need a starting quote before the name of the file:

CKEDITOR.replace(   'elementname',
   {
       customConfig : 'customConfigFile.js',
       width :   '500px',
       height: '200px'
   }
);


It looks like @Danny Cohn has also entered this question in the CKEditor community forum. The "answer" he received there didn't answer the question.

In my experience with this, when multiple ckeditors on a page each have their own customConfig specified, the last one in wins and must contain data (eg, toolbars) for the other editors on the page (as well as the last one) to work.


This is a known issue.

See: http://dev.ckeditor.com/ticket/6504.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜