博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
72. js EXTJS grid renderer用法
阅读量:7106 次
发布时间:2019-06-28

本文共 1004 字,大约阅读时间需要 3 分钟。

转自:https://blog.csdn.net/shancunxiaoyazhi/article/details/22156083

renderer : Function

(可选的)该函数用于加工单元格的原始数据,转换成为HTML并返回给GridView进一步处理。如不指定,则对原始数据值进行默认地渲染。

例:renderer:function(value, cellmeta, record, rowIndex, columnIndex, store){

}

 

extjs grid renderer可以配置6个参数,其中第3个参数可以获以该行的其它数据  record.data["id"]

var cm = new Ext.grid.ColumnModel(

[
new Ext.grid.RowNumberer({ header: "", width: 20, align: 'center' }),
{ header: '帐号', align: 'center', dataIndex: 'UserAccountName', width: 200, sortable: true },
{ header: '角色名', align: 'center', dataIndex: 'UserRoleName', width: 200, sortable: true },
{ header: '状态', align: 'center', dataIndex: 'UserAccountStateId', width: 200, sortable: true, hidden: true,renderer: function() }
]

 

renderer:function(value, cellmeta, record, rowIndex, columnIndex, store){

}

]

1.value是当前单元格的值

2.cellmeta里保存的是cellId单元格id

3.record 该行的所有数据,取值 record.data["UserRoleName"]  。

4.rowIndex是行号,计算了分页以后的结果。
5.columnIndex列号。
6.store 表格时候传递的ds

转载于:https://www.cnblogs.com/sharpest/p/7657563.html

你可能感兴趣的文章
001_各种网页错误代码解释(400.404.504等)
查看>>
设计模式——辛格尔顿(Singleton)
查看>>
MySQL忘记root密码的找回方法
查看>>
linux下使用tar命令
查看>>
js Dialog 去掉右上角的X关闭功能
查看>>
Spring aop 小例子demo
查看>>
Ambari修改主页面方法
查看>>
SolrJ总结
查看>>
CSS选择器的权重与优先规则
查看>>
jquery序列化form表单使用ajax提交后处理返回的json数据
查看>>
iOS设计模式 - 模板
查看>>
VSS Plugin配置FAQ(翻译)[转]
查看>>
javaSE之Object及hashcode等相关知识
查看>>
js 判断是否选中
查看>>
svn提交时强制注释
查看>>
Callable 获取线程返回值
查看>>
ecshop 活动-》红包
查看>>
linux网络编程学习笔记之二 -----错误异常处理和各种碎碎(更新中)
查看>>
js中的string.format函数代码
查看>>
Too many levels of symbolic links 问题
查看>>