2012-04-17 59 views
3

我試圖找到一種方法來使ckeditor對話框中的輸入只讀。如何使ckeditor對話框中的輸入只讀

我已經初始化內容是這樣的:

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

展望documentation我想唯一的辦法就是一些CSS樣式應用到輸入?

+0

http://cksource.com/forums/viewtopic.php?t=15659 – LeonardChallis 2012-04-17 11:40:42

+0

@LeonardChallis,這將使只讀整個CKEditor的實例 - 在OP想使1個輸入只讀對話框上的字段。 – 2012-04-17 11:41:38

回答

3

我發現在CKEditor的源的溶液碼。只是需要把這個元素相加初始化

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

我知道這是一箇舊帖子,但我有同樣的問題,並想知道如果你可以幫助...我需要將這添加到** ckeditor /插件/圖像/對話框中的'onLoad'/image.js **文件?在這個文件中已經有兩個'onLoad'函數,但是上面的代碼在添加到這裏時似乎沒有辦法實現。非常感謝任何幫助,謝謝! – WheretheresaWill 2013-02-22 13:25:19

+0

在image.js中搜索'id:「txtUrl」'並在on-plus事件中追加新函數,在un-minified版本中,它在行192上使用Ckditor4。 – Pranav 2014-04-01 09:15:18