easyui-dialog中無法顯示KindEditor外掛程式
KindEditor是一種用起來還不錯的富文字編輯器外掛程式;easyui是一個前端外掛程式,其中有一個彈出框功能——dialog。在實際使用的時候,我們需要在彈出框當中展示富文字編輯器,從而進行編輯和儲存功能,再進行背景操作。但是我在使用easyui的彈出框的時候出現了問題,無法顯示kindeditor外掛程式,而不在dialog中使用時候是可以顯示的,這是為什麼。要怎麼解決。 問題發生的原因
dialog在彈出框時的初始化操作,沒有成功初始化KindEditor 解決方式
在easyui的dialog初始化的onOpen方法中來初始化kindeditor:
$(‘#list1’).dialog({
onOpen: function(){
editor1 = KindEditor.create(‘#summary1’, {
height :”300px”,
uploadJson : ‘../cycx/picFtpUpload.do’,
afterBlur: function () {
this.sync();
},
filterMode: true,//是否開啟過濾模式
allowFileManager: true,
afterChange : function() {
},
onBeforeClose: function (event, ui) {
// 關閉Dialog前移除編輯器
editor1.remove(‘#summary1’);
},
items : [ ‘source’, ‘|’, ‘undo’, ‘redo’, ‘|’, ‘cut’, ‘copy’, ‘paste’,
‘plainpaste’, ‘wordpaste’, ‘|’, ‘justifyleft’, ‘justifycenter’, ‘justifyright’,
‘justifyfull’, ‘subscript’,
‘superscript’, ‘quickformat’, ‘|’,
‘formatblock’, ‘fontname’, ‘fontsize’, ‘|’, ‘/’,’forecolor’, ‘hilitecolor’, ‘bold’,
‘italic’, ‘underline’, ‘strikethrough’, ‘lineheight’, ‘removeformat’, ‘|’, ‘image’,
‘table’, ‘hr’, ‘pagebreak’,
‘link’, ‘unlink’, ‘about’, ‘|’]
});
},
onClose:function(){
editor1.remove(‘#summary1’);
},
modal: true
});
參考文章:http://blog.csdn.net/qinnimei/article/details/77319684