Javascript 如何在CkEditor的表属性中禁用标题?
如何在CKEditor的表属性中禁用标题,如下图中的行和列的标题Javascript 如何在CkEditor的表属性中禁用标题?,javascript,asp.net,ckeditor,Javascript,Asp.net,Ckeditor,如何在CKEditor的表属性中禁用标题,如下图中的行和列的标题 我正在asp.net web应用程序中使用CKEditor 3.0版,我试图在table.js(在plugins-->table文件夹中)中进行一些更改,但没有得到所需的输出。使用对话框定义事件(): 你可以试试这样的东西,对我很管用 window.CKEDITOR.on('dialogDefinition', function (ev) { var dialogName = ev.data.name;
我正在asp.net web应用程序中使用CKEditor 3.0版,我试图在table.js(在plugins-->table文件夹中)中进行一些更改,但没有得到所需的输出。使用
对话框定义
事件():
你可以试试这样的东西,对我很管用
window.CKEDITOR.on('dialogDefinition', function (ev) {
var dialogName = ev.data.name;
var dialogDefinition = ev.data.definition;
ev.editor.getCommand( 'table' ).allowedContent = "table{width,height}[align,border,cellpadding,cellspacing,summary];caption tbody thead tfoot;th td tr;table[id,dir](*){*}";
if (dialogName == "table" || dialogName == "tableProperties") {
var infoTab = dialogDefinition.getContents("info");
infoTab.get("txtWidth")["default"] = "";
infoTab.get("txtCellSpace")["default"] = "";
infoTab.get("txtCellPad")["default"] = "";
infoTab.get("txtBorder")["default"] = "";
infoTab.get("selHeaders")["items"].pop();
infoTab.get("selHeaders")["items"].pop();
var advancedTab = dialogDefinition.getContents( 'advanced' );
advancedTab.remove( 'advCSSClasses' );
}
});
检查我之前的答案,您可以使用
dialogDefinition
event.Thanx@oleq作为解决方案,但是我在ckeditor.js中做了一些更改,它对我很有用。:)@oleq如果你发布了一个解决这个问题的答案(不是像你以前的答案那样的通用解决方案),那么我想把它标记为正确答案并投票表决。它给出了一个错误,当我在javascript中粘贴你的代码时,CKEDITOR是未定义的,我想CKEDITOR在那之前不会加载…你知道该怎么办吗?@SidM你读了吗?还是不起作用…不知道为什么?虽然你的解决方案看起来不错,但为什么它对我不起作用?我刚刚把这个粘贴到了ckeditor的源代码text
,这个下拉列表仍然处于启用状态:(老实说,我应该说,你应该得到一个或多个向上投票,但它仍然不适合我。if(dialogName==“table”&&dialogName==“tableProperties”){
这应该如何工作-D@Wolfgang,是的,你是对的。那个条件是错误的。我现在已经纠正了。谢谢你强调它。
window.CKEDITOR.on('dialogDefinition', function (ev) {
var dialogName = ev.data.name;
var dialogDefinition = ev.data.definition;
ev.editor.getCommand( 'table' ).allowedContent = "table{width,height}[align,border,cellpadding,cellspacing,summary];caption tbody thead tfoot;th td tr;table[id,dir](*){*}";
if (dialogName == "table" || dialogName == "tableProperties") {
var infoTab = dialogDefinition.getContents("info");
infoTab.get("txtWidth")["default"] = "";
infoTab.get("txtCellSpace")["default"] = "";
infoTab.get("txtCellPad")["default"] = "";
infoTab.get("txtBorder")["default"] = "";
infoTab.get("selHeaders")["items"].pop();
infoTab.get("selHeaders")["items"].pop();
var advancedTab = dialogDefinition.getContents( 'advanced' );
advancedTab.remove( 'advCSSClasses' );
}
});