How to change plugin setting dynamically in CKEDITOR?

老子叫甜甜 提交于 2021-01-28 03:50:13

问题


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

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
};

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

Is there an easy way to achieve this?


回答1:


Found the solution:

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


来源:https://stackoverflow.com/questions/34606896/how-to-change-plugin-setting-dynamically-in-ckeditor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!