扫码关注官方订阅号
问题:Easyui dialog 打开加载UEditor第一次会成功,第二次打开就无效了
人生最曼妙的风景,竟是内心的淡定与从容!
dialog在关闭时需要销毁ueditor创建的对象,再次打开时重新渲染编辑器,参考代码:
页面:
<textare class="ueditor" id="content" ex-id="content"></textarea>
JavaScript代码:
$('#dd').dialog({ onLoad:function(){ if($('textarea.ueditor').length > 0){ $('textarea.ueditor').each(function(){ var id = $(this).attr('id'); UE.getEditor(id, UeditorOptions); }); } }, onClose:function(){ //销毁所有的ueditor if($('textarea.ueditor').length > 0 && typeof (UE) !== "undefined"){ $('textarea.ueditor').each(function(){ UE.getEditor($(this).attr('ex-id')).destroy(); }); } } });
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
dialog在关闭时需要销毁ueditor创建的对象,再次打开时重新渲染编辑器,参考代码:
页面:
JavaScript代码: