如何在CKEDITOR中动态更改插件设置? [英] How to change plugin setting dynamically in CKEDITOR?

查看:74
本文介绍了如何在CKEDITOR中动态更改插件设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

创建CKEDITOR实例后,如何动态更改插件设置?

How can I manage to change a setting of a plugin dynamically when CKEDITOR instances are created?

我在自定义config.js中写过:

I wrote in a custom config.js:

config.wordcount = {
    // Whether or not you want to show the Word Count
    showWordCount: false,
    // Whether or not you want to show the Char Count
    showCharCount: true
};

我要做的是根据CKEDITOR实例将 maxCharCount 设置为某种值.

What I want to do is to set maxCharCount to something, depending on the CKEDITOR instance.

有没有简单的方法来实现这一目标?

Is there an easy way to achieve this?

推荐答案

找到了解决方案:

CKEDITOR.replace('field', {
    wordcount: {'showWordCount': false,
                'showParagraphs': false,
                'showCharCount': true,
                'maxCharCount': 100
            }
});

这篇关于如何在CKEDITOR中动态更改插件设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆