需要添加一句代码 afterBlur: function(){this.sync();}当失去焦点时,这个函数就是同步KindEditor的值到textarea文本框
function create_kindeditor(textarea){
var editor = KindEditor.create(textarea, {
allowFileManager : true,
searchManagerJson : textarea.attr('plusSearchUrl'),
uploadJson : textarea.attr('plusUploadUrl'),
fileManagerJson : textarea.attr('plusFileManagerUrl'),
filterMode : false,
wellFormatMode : true,
afterBlur: function(){this.sync();},
items:[
'source', '|', 'undo', 'redo', '|', 'preview', 'template','|', 'justifyleft', 'justifycenter', 'justifyright',
'insertorderedlist', 'insertunorderedlist','clearhtml', 'quickformat', '|', 'table', 'hr', 'emoticons',
'strikethrough', 'lineheight', 'removeformat', '|','anchor', 'link', 'unlink','pagebreak','|',
'/',
'formatblock','fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold','italic', 'underline','image','keyword'
]
});
}
标签: Kindeditor 编辑 提交