flexigrid的处理函数使用闭包传递this对象
来源:互联网 发布:cdn加速 nginx ip限制 编辑:程序博客网 时间:2024/04/29 17:29
很多时候,process函数都需要获得this对象,然后调用一些方法。
下面举个例子:
config : function (groupName, description, deviceNumber, del) { var ob = this; $("#groups").flexigrid({ dataType: 'json', width: 870, height: 300, colModel : [{ display: groupName, name: 'groupName', width: 200, sortable: true, align: 'left', process: (function (ob, hdl) {return function (celDiv, id) { hdl(ob, celDiv, id);}; }(ob, ob.editName))},{ display: description, name: 'description', width: 469, sortable: true, align: 'left', process: (function (ob, hdl) {return function (celDiv, id) { hdl(ob, celDiv, id);}; }(ob, ob.editDescription))},{ display: deviceNumber, name: 'deviceNumber', width: 110, sortable: true, align: 'left'},{ display: del, name: 'del', width: 25, sortable: true, align: 'left', process: (function (ob, hdl) {return function (celDiv, id) { hdl(ob, celDiv, id);}; }(ob, ob.remove))} ]} ); $.ajaxSetup({ cache: false });},
1 0
- flexigrid的处理函数使用闭包传递this对象
- flexigrid 的使用【添加错误处理功能】
- js函数--闭包和this对象
- bind(this)绑定this指向的对象、箭头函数和闭包
- Jquery 查询数据库记录进行显示在FlexiGrid 以及前后台的值传递、对象传递
- FlexiGrid的使用
- javascript 闭包 this 匿名函数 匿名对象
- JavaScript关于闭包,匿名函数,this,对象等的一些理解
- 闭包中的this对象
- JavaScript闭包--this对象
- js this,闭包的使用
- 关于使用Flexigrid的问题
- Flexigrid的使用(整合Struts2)
- javascript 闭包 传递对象
- 面向对象----构造方法、this 关键字、函数的参数传递、package语句/import语句
- 重新认识JS的this、作用域、闭包、对象
- 面向对象基础——引用传递及其应用以及this关键字的使用
- javascript 闭包(closure) 与匿名函数的this
- Spring事务配置的五种方式
- RotationToInterfaceOrientation in iOS 6.0
- GetSystemMetrics与GetDeviceCaps
- HDU 2846 Repository(字典树变形)
- 如何安装Oracle WebCenter Suite 11g
- flexigrid的处理函数使用闭包传递this对象
- 黑马程序员26——OC之内存管理(property参数)
- IOS笔试题
- Java 并发编程之任务取消(八)
- 小结
- OPENCV2.4.8环境配置
- (白书训练计划)UVa 11054 Wine trading in Gergovia(等价转换)
- 发送消息
- 数据库学习--写mysql语句经验谈