1
我在獲取現有實例時遇到問題。CKEditor:無法獲取CKEditor的現有實例
文本區:
{{ textarea name=ec.ec_id value=ec.ecl_body placeholder=ec.ecl_en_body class="form-control" }}
的CKEditor:
function createEditor(name)
{
CKEDITOR.replace(name, {
//uiColor: '#379e15',
resize_dir: 'both',
resize_maxWidth: '800',
toolbarGroups: [{name: 'basicstyles', groups: ['basicstyles', 'cleanup']},
{name: 'paragraph', groups: ['list', 'indent', 'blocks', 'align', 'bidi']},
{name: 'links'}, {name: 'editing', groups: ['find', 'selection', 'spellchecker']}]
});
}
createEditor(email.ec_id); //Its working
獲取數據:
var data = CKEDITOR.instances[email.ec_id];
錯誤: 數據不確定
你確定'email.ec_id'與你給'textarea'的'ec.ec_id'屬性相匹配嗎? –
是的,它是一個對象 –
@Rory我喜歡CKEditor不返回實例。 –