问题
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