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不返回实例。 –