• Spring框架整合百度编辑器遇到的问题


    ueditor文档:http://fex.baidu.com/ueditor/

    1:准备工作,下载demo 选jsp的

    2http://fex.baidu.com/ueditor/#server-jsp

    3:框架拦截后缀为.jsp的文件请求,所以需要放过数据,免得取不到数据,改web.xml文件放过权限

    4:页面中初始化遇到的问题:

    • 直接初始化渲染不出来,或者第一次正常,二次加载不正常,需要先删在建才能正常渲染
    • UE.getEditor('container3').render('container3')  这种html切换有异常,暂不做考虑了  参考文章:https://blog.csdn.net/zrk1000/article/details/46865093#commentBox
    • 还是用UE.getEditor这种可以自定义栏目图标,先删除在创建就没问题了
    UE.delEditor('container2');//可能是缓存问题导致的,因此先删除缓存中已有的富文本
            var ue = UE.getEditor('container2', {
                toolbars: [
                           ['fullscreen', 'source', 'undo', 'redo', 'bold']
                       ],
                       autoHeightEnabled: true,
                       autoFloatEnabled: true
                   }
            );//再重新渲染

    //不自定义标签
    UE.delEditor('container3'); UE.getEditor('container3');

    但删除缓存中的富文本这个在IE下不兼容,参考文章https://blog.csdn.net/wslpeter1987/article/details/76530075

    那解决起来就比较简单:

    正常渲染某个container为富文本的做法是:UE.getEditor("container");但这里我们不用这个方法,我们直接自己模仿ueditor.all.js中getEditor()方法来实现container的渲染:

    var editor = new UE.ui.Editor(opt);

    editor.render(id);

    其中opt,id就是UE.getEditor(id,[opt])方法的签名,opt是可选项,而且可以看出,如果一个页面渲染多个container;editor只需实例化一次就ok

    var editor = new UE.ui.Editor(opt);

    editor.render(id1);

    editor.render(id2);

    editor.render(id3);

    还有另外一种删除,暂没试

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

    UEditor 第一次加载正常,第二次无法正常加载问题

  • 相关阅读:
    分数序列规律求和
    猴子吃桃算法
    猴子吃桃算法
    完数
    完数
    数字个数依次叠加 s=a+aa+aaa+aaaa+aa...a
    数字个数依次叠加 s=a+aa+aaa+aaaa+aa...a
    hbase(二)Java操作 hbase
    hbase scan startrow endrow 是否包括
    ListOrderedMap和Map
  • 原文地址:https://www.cnblogs.com/MuZi0627/p/10614310.html
Copyright © 2020-2023  润新知