function GetFollowList(page) {
var pages = { rows: , 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 = ; 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("保存出现问题了,请联系管理员!");
}
});
});
});
}

MVC ---- ckeditor 循环遍历并绑定blur事件的更多相关文章

  1. MVC ---- ckeditor 批量绑定 blur 事件

    在项目遇到个问题,就是把循环出来的ckeditor 批量添加 blur 事件,折腾了2天 终于搞定 @{ ].Rows) { <table class="ui-jqgrid-btabl ...

  2. JS CKEditor使用setData后绑定click事件

    CKEditor使用setData()时会自动丢失初始时绑定的时间,在百度时发现有很多方法都不对. 近期在做项目的时候,由于客户需要,将原来的文本格式的textarea标签更改成富文本编辑器--CKE ...

  3. 循环遍历DataTable绑定到Table

    VoteList2.cs: using System; using System.Collections.Generic; using System.Linq; using System.Web; u ...

  4. input绑定datapicker控件后input再绑定blur或者mouseout等问题

    input绑定datapicker控件后input再绑定blur或者mouseout等问题 问题描述:今天在修改一个东西的时候需要给一个input输入域绑定blur事件,从而当它失去焦点后动态修改其中 ...

  5. 理解Javascript中的事件绑定与事件委托

    最近在深入实践js中,遇到了一些问题,比如我需要为动态创建的DOM元素绑定事件,那么普通的事件绑定就不行了,于是通过上网查资料了解到事件委托,因此想总结一下js中的事件绑定与事件委托. 事件绑定   ...

  6. jQuery 1.4版本的15个新功能(现在已经发布到jquery1.8,特别是增强版的live事件,支持 submit , change , focus 和 blur 事件)

    1.jQuery()创建DOM元素:支持传参设置属性 之前,jQuery可以通过 attr 方法设置元素的属性,既可传属性的名和值,也可以是包含几组特定 属性名值对 的 对象.在 jQuery 1.4 ...

  7. for for in 给已有的li绑定click事件生成新的li也有click事件

    想要给已有的li元素绑定一个click事件,点击生成新的li元素,并且新的li元素也要有click事件 //不能用for循环给每个li绑定click事件 因为这样的话 后面新生成的li就没有click ...

  8. vue组件,vue补充和总结,JS循环遍历和加减运算、类型转换补充

    目录 一.vue中的组件 1. 组件的概念 2. 组件分类 3. 组件的特点 4. 组件的定义 5. 组件化 (1)用法和注意 (2)数据组件化实例 6. 组件传参--父传子 (1)用法和注意 (2) ...

  9. 说说focus /focusin /focusout /blur 事件

    事件触发时间 focus:当focusable元素获得焦点时,不支持冒泡:focusin:和focus一样,只是此事件支持冒泡:blur:当focusable元素失去焦点时,不支持冒泡:focusou ...

随机推荐

  1. PHPExcel使用-使用PHPExcel导出文件-导出MySQL数据

    现在数据库里面有一组数据,我们将它按照不同的难度进行分sheet. 首先我们需要写一个mysql的配置文件- db.config.php(utf-8编码) : <?php $dbconfig= ...

  2. PHP Warning: preg_match(): JIT compilation failed: no more memory in

    PHP7.3出现如下错误:PHP Warning: preg_match(): JIT compilation failed: no more memory in ... 解决方案: 修改 /usr/ ...

  3. Sqoop导入HBase,并借助Coprocessor协处理器同步索引到ES

    1.环境 Mysql 5.6 Sqoop 1.4.6 Hadoop 2.5.2 HBase 0.98 Elasticsearch 2.3.5 2.安装(略过) 3.HBase Coprocessor实 ...

  4. [vue]v-bind: sytle/class-bind&属性值绑定

    v-bind - style绑定 - class绑定 - 属性值绑定 <!DOCTYPE html> <html lang="en"> <head&g ...

  5. python 根据路径导入模块

    Import python module NOT on path http://stackoverflow.com/questions/10161568/import-python-module-no ...

  6. 当输入域失去焦点 (blur) 时改变其颜色

    $("input").blur(function(){ $("input").css("background-color","#D ...

  7. 使用i5ting_toc 预览 markdown 文件

    i5ting_toc__tree https://github.com/i5ting/i5ting_ztree_toc 是去哪儿网前段架构师狼叔编写的一个jQuery插件,用于将markdown 转化 ...

  8. X-UA-Compatible

    X-UA-Compatible是神马? X-UA-Compatible是IE8的一个专有<meta>属性,它告诉IE8采用何种IE版本去渲染网页,在html的<head>标签中 ...

  9. div居中布局

    利用margin属性可以实现div居中布局,把div的左边距和右边距设置为auto即可,代码如下 <!DOCTYPE html> <html> <head> < ...

  10. 穿透内网,连接动态ip,内网ip打洞-----p2p实现原理

    转:http://blog.csdn.net/suhuaiqiang_janlay/article/details/60466333 本人找几篇讲得好的来整理一下. (1)问题的由来: (2)动态ip ...