• MVC ---- ckeditor 循环遍历并绑定blur事件


        function GetFollowList(page) {
            var pages = { rows: 1, pages: page };
            pages = JSON.stringify(pages);
            var datas = { param: pages }
            $.ajax({
                url: "/Business/CustomerFollow/PaginationList",
                data: datas,
                dataType: "json",
                success: function (da) {
                    var htmls = "";
                    var datas = da.followlist;
                    var saa = [];
                    for (var i = 0; i < datas.length; i++) {
    
                        htmls += "<table class="ui-jqgrid-btable ui-common-table table table-bordered" style=" background:#ffffff!important; margin-bottom:30px;"><tr class="jqgfirstrow"><td style="height:50px;line-height:50px;">" + datas[i].CustomerId + "</td>" +
                                 "<td style="height:50px;line-height:50px;">" + datas[i].F_FullName + "</td><td style="height:50px;line-height:50px;">" + datas[i].F_Msisdn + "</td>" +
                                 "<td style="height:50px;line-height:50px;">" + datas[i].F_CreatorTime + "</td><td style="height:50px;line-height:50px;">" + datas[i].F_CreatorUserName + "</td></tr>" +
                                 "<tr><td colspan="5"><textarea id="" + datas[i].FollowId + "" class="ckeditor">" + datas[i].F_Description + "</textarea></td></tr></table>";
                        saa.push(datas[i].FollowId);
                    }
    
                    $("#tbodyHtmlId").html(htmls);
                    for (var j in saa) {
                        CKEDITOR.replace(saa[j]);
                        addblur();
                    }
                     
                },
                error: function (XMLHttpRequest, textStatus, errorThrown) {
                    alert("XMLHttpRequest==" + XMLHttpRequest + "==textStatus" + textStatus + "==errorThrown=" + errorThrown);
                }
            });
        }




        $(function () {
    
            $('.ckeditor').each(function (i, item) {
                var a = $(this).attr("id");
                CKEDITOR.instances[a].on('blur', function () {
    
                    alert(i);
                    var tent = this.document.getBody().$.innerHTML;//获取当前内容。
                    var param = { fids: a, contents: tent }
                    var params = JSON.stringify(param);
                    $.ajax({
                        type: "Post",
                        url: "/Business/CustomerFollow/Update",
                        data: { "param2": params },
                        dataType: "json",
                        success: function (da) {
                        },
                        error: function (err) {
                            alert("保存出现问题了,请联系管理员!");
                        }
                    });
                });
            });
        });
    
        function addblur() {
            $('.ckeditor').each(function (i, item) {
                var a = $(this).attr("id");
                CKEDITOR.instances[a].on('blur', function () {
                    var tent = this.document.getBody().$.innerHTML;//获取当前内容。
                    var param = { fids: a, contents: tent }
                    var params = JSON.stringify(param);
                    $.ajax({
                        type: "Post",
                        url: "/Business/CustomerFollow/Update",
                        data: { "param2": params },
                        dataType: "json",
                        success: function (da) {
                        },
                        error: function (err) {
                            alert("保存出现问题了,请联系管理员!");
                        }
                    });
                });
            });
        }
  • 相关阅读:
    批量kill session实现脚本
    mysql 5.7.34 gtid 复制模式下执行 reset master 命令后 slave 节点的处理
    修改listener的inbound_connect_timeout参数的方法
    ORA-609 : opiodr aborting process unknown ospid
    mysqldump用法总结
    重置mysql主从同步:reset master和reset slave
    Too many connections
    redisson实现分布式锁(spring整合redisson)
    Caused by: java.lang.ClassNotFoundException: org.springframework.data.util.CloseableIterator
    Caused by: java.lang.ClassNotFoundException: org.springframework.data.keyvalue.core.mapping.context.KeyValueMappingContext
  • 原文地址:https://www.cnblogs.com/youmingkuang/p/7277924.html
Copyright © 2020-2023  润新知