easyui 使用 kindeditor 注意事项
参考:https://www.cnblogs.com/dogdogwang/p/6927473.html
在实际的项目中,我们需要在项目中集成富文本编辑器,而kindeditor作为一款优良的编辑器,在项目中或多或少都会用到!
使用方法:
1.首先下载Kindeditor编辑器,我这里使用的是4.1.10版本。下载地址:http://kindeditor.net/down.php;
2.在所需页面上引入Kindeditor相关js文件(注意引入路径):
3.在所需页面上需要一个,(注意ID号唯一)如下所示:
4.在页面创建Kindeditor(参数自己可以根据实际项目选配):
$(function(){
var editor;
window.editor = KindEditor.create('#content',{
resizeType:1,
urlType:'domain', // 带有域名的绝对路径
});
});
2.切记使用以下方式,使用以下方式会导致在谷歌、火狐等浏览器下无法正常显示编辑器。因为KindEditor.ready无法正常执行。
var editor;
KindEditor.ready(function(K){
window.editor = K.create('#content',{
resizeType:1,
urlType:'domain', // 带有域名的绝对路径
});
});
3. 在提交表单 前 一定要执行 editor.sync() 方法 ,否则 kindeditor中的值不会被同步到 表单对应的文本框中