【发布时间】:2022-08-01 22:33:08
【问题描述】:
我在 GridView 上的 Web 应用程序中使用 CKEditor ,需要从 javascript 禁用/启用编辑器。
如果 gridview 行不在编辑模式下,我需要禁用编辑器,否则我需要启用编辑器。
我知道有一个名为
readOnly
的选项,我尝试过使用
config.js
CKEDITOR.editorConfig = function (config) {
config.removePlugins = 'bidi,image,forms,adobeair,devtools,find,maximize,a11yhelp,about,divarea,liststyle,tabletools,tableresize,contextmenu,codemirror,docprops,preview,smiley,sourcearea,save,flash,iframe,tabletools,templates,showblocks,newpage,language,print,div';
config.width = '700';
config.height = '200';
config.readOnly = true;
};
但是当gridview的行不在编辑模式时,即使无法保存文本,它仍然可以在编辑器中写入
请问有人知道如何禁用和启用CKEditor吗?