ckeditor使对话框元素只读或禁用

ckeditor使对话框元素只读或禁用,ckeditor,Ckeditor,我需要能够使链接对话框窗口中的URL输入字段只读或禁用它。当用户从服务器选择文件时,将填充该字段 另一个用户将此链接作为解决方案发布,但没有示例,我也不知道如何实现它 我明白了。我添加了这个.getInputElement().setAttribute('readOnly',true);到ckeditor\plugins\links\dialogs\link.js中的onload函数。在我将其添加到ckeditor\\u source\plugins\links\dialogs\link.js之

我需要能够使链接对话框窗口中的URL输入字段只读或禁用它。当用户从服务器选择文件时,将填充该字段

另一个用户将此链接作为解决方案发布,但没有示例,我也不知道如何实现它


我明白了。我添加了这个.getInputElement().setAttribute('readOnly',true);到ckeditor\plugins\links\dialogs\link.js中的onload函数。在我将其添加到ckeditor\\u source\plugins\links\dialogs\link.js之前。我仍然想要一个如何使用CKEDITOR.ui.dialog.ui元素禁用功能的示例,如果任何人都有此功能。

在对话框的onLoad处理程序中,您可以通过以下方式禁用它:

this.getContentElement("info", "url").disable();

这就是我最后做的。我把它写在我的js文件中而不是插件文件中,但我不认为这会有什么不同。我使用的是内联编辑器版本4.0.2

CKEDITOR.on('dialogDefinition', function(event) {
    var dialogName = event.data.name;
    var dialogDefinition = event.data.definition;
    //some code here

    if(dialogName == 'flash'){ // flash dialog box name
        //some code here

        dialogDefinition.onShow = function () {
            this.getContentElement("info","width").disable(); // info is the name of the tab and width is the id of the element inside the tab
            this.getContentElement("info","height").disable();
        }
    }
});

只需一行即可禁用url字段

CKEDITOR.dialog.getCurrent().getContentElement('info','txtUrl').disable()

这是一个内置的对话框。查看相应的IJG插件文件并禁用它是的,我添加了这个.getInputElement().setAttribute('readOnly',true);到onload函数,但它不起作用。我想出来了。我在下面发布了答案可能是我们可以从配置文件进行设置。你的意思是说你的代码在3.6中运行,但现在升级到4后就不工作了,还是说你从4开始,但无法使其工作?我从4开始,禁用()不存在,它是存在的:如果没有很好的理由就更改API并删除该方法,那将是非常奇怪的。我现在已经试过了,只粘贴了那一行,url字段就被禁用了。你能试试flash插件吗?我试过了,但它给出的对象没有这样的方法。还是因为我在使用内联编辑器?非常感谢。是否也可以“隐藏”它,而不仅仅是禁用它?是的,但您必须跟踪domId ckeditor用于该特定元素并使用css隐藏它