最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to make input readonly in ckeditor dialog - Stack Overflow

programmeradmin5浏览0评论

I'm trying to find a way to make input in ckeditor dialog readonly.

I have initialized elements like this:

type: 'hbox',
widths: ['25%', '75%'],
children:
    [{
        type: 'text',
        id: 'moduleId',
        label: 'Module',

Looking in documentation I guess the only way is to apply some css style to input?

I'm trying to find a way to make input in ckeditor dialog readonly.

I have initialized elements like this:

type: 'hbox',
widths: ['25%', '75%'],
children:
    [{
        type: 'text',
        id: 'moduleId',
        label: 'Module',

Looking in documentation I guess the only way is to apply some css style to input?

Share Improve this question edited Apr 17, 2012 at 11:40 Rory McCrossan 338k41 gold badges320 silver badges351 bronze badges asked Apr 17, 2012 at 11:36 rushegorushego 3053 silver badges11 bronze badges 2
  • cksource./forums/viewtopic.php?t=15659 – LeonardChallis Commented Apr 17, 2012 at 11:40
  • @LeonardChallis that will make the entire CKEditor instance readonly - the OP wants to make 1 input field on a dialog readonly. – Rory McCrossan Commented Apr 17, 2012 at 11:41
Add a ment  | 

2 Answers 2

Reset to default 5

I have found a solution in ckeditor source code. Just need to add this to element initialization

onLoad : function()
{
    this.getInputElement().setAttribute( 'readOnly', true );
}

I'm not sure if you can set an element as disabled on the definition, but you can get the element after the dialog has been loaded and disable it: http://docs.cksource./ckeditor_api/symbols/CKEDITOR.ui.dialog.uiElement.html#disable

发布评论

评论列表(0)

  1. 暂无评论