Ueditor富編輯器第二次打開的時候會渲染失敗

1、在頁面或窗口關閉的時候,通過監聽頁面或窗口事件,在函數裏面銷燬富編輯器

if(typeof(UE.getEditor("newsContentAdd")) !='undefined'){
         UE.getEditor("newsContentAdd").destroy();
}

2、在頁面每次初始化的時候,先刪除掉以前的編輯器,再次進行初始化

//先刪除掉以前的ueditor,否則第二次打開的時候會渲染失敗
UE.delEditor("newsContent");
//初始化渲染ueditor
var newsContent = UE.getEditor('newsContent',{
initialFrameWidth:1000,initialFrameHeight:450,
toolbars:[
          ['source','undo','redo','bold','italic','underline','fontborder','strikethrough','superscript','subscript', 'removeformat','formatmatch','autotypeset','blockquote','pasteplain','|','forecolor','backcolor','insertorderedlist','insertunorderedlist','selectall','cleardoc','rowspacingtop','rowspacingbottom','lineheight','|','background'],
          ['fontfamily','fontsize','|','justifyleft','justifycenter','justifyright','justifyjustify','|','imagenone','imageleft','imageright','imagecenter','|','insertimage','emotion','|','inserttable','deletetable','insertparagraphbeforetable','insertrow','deleterow','insertcol','deletecol','mergecells','mergeright','mergedown','splittocells','splittorows','splittocols','|','preview']
         ]
    ,emotionLocalization:true
    ,wordCount:false,autoFloatEnabled:false
});

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章