Ext.grid.ColumnModel renderer 参数介绍
来源:互联网 发布:linux 改机器名 编辑:程序博客网 时间:2024/05/16 09:11
Ext.grid.ColumnModel renderer 参数介绍 .
使用时注意参数顺序位置:
1. renderer:function (value, cellmeta, record, rowIndex, columnIndex, store) {
value :这个单元格的值;
cellmeta.cellId: 这个单元格的配置
cellmeta.id: id
record :这个单元格对应的record
rowIndex 这是第几行
store 这个表格对应的Ext.data.Store
}
2. function renderDescn(value, cellmeta, record, rowIndex, columnIndex, store) {
var str = "<input type='button' value='查看详细信息' onclick='alert(/"" +
"这个单元格的值是:" + value + "//n" +
"这个单元格的配置是:{cellId:" + cellmeta.cellId + ",id:" + cellmeta.id + ",css:" + cellmeta.css + "}//n" +
"这个单元格对应行的record是:" + record + ",一行的数据都在里边//n" +
"这是第" + rowIndex + "行//n" +
"这是第" + columnIndex + "列//n" +
"这个表格对应的Ext.data.Store在这里:" + store + ",随便用吧。" +
"/")'>";
return str;
}
使用实例:
//--------------------------------------------------列选择模式
var sm = new Ext.grid.CheckboxSelectionModel({
dataIndex: "openroomid"
});
//--------------------------------------------------列头
var cm = new Ext.grid.ColumnModel([
sm, {
header: "开房ID",
dataIndex: "openroomid",
tooltip: "开房唯一标识ID",
//列不可操作
//menuDisabled:true,
//可以进行排序
sortable: true
}, {
header: "房间号",
tooltip: "客人所住房间编号",
dataIndex: "roomid",
sortable: true,
renderer: function(value) {
return "<a herf='Default.aspx' target='_blank'>" + value + "</a>"
}
}, {
header: "所付定金",
tooltip: "客人所付定金",
dataIndex: "guestmoney",
sortable: true,
renderer: function(value) { //将数字转换为整数
if (value != null && value != "") {
var a, b, c, i
a = value.toString();
b = a.indexOf('.');
c = a.length;
if (b != -1)
a = a.substring(0, b);
}
if (b == -1) {
a = a + ".";
for (i = 1; i <= c; i++)
a = a - "0";
}
else {
a = a.substring(0, b + c + 1);
for (i = c; i <= b + c; i++) {
a = a - "0";
}
}
return '<span style="color:red;"><b>' + String.format("<font color=red>¥{0}</font>", a) + '</b> 元</span>';
}
}, {
header: "开房日期",
tooltip: "开房具体日期",
dataIndex: "OpenTodayTime",
sortable: true
}]);
- Ext.grid.ColumnModel renderer 参数介绍
- Ext.grid.ColumnModel renderer 参数介绍 .
- Ext.grid.ColumnModel renderer 参数介绍
- ext 中 columnModel的renderer
- Ext.grid.ColumnModel
- Ext.grid.ColumnModel
- Ext.grid.ColumnModel
- Ext.grid.ColumnModel
- Ext.grid.ColumnModel设置
- Ext.grid.ColumnModel 属性 详解
- Ext js 中grid的renderer参数含义
- ext renderer方法参数
- ext renderer参数
- Ext renderer参数详解
- Ext.grid.ColumnModel列宽度自动填满grid宽度
- ext Ext.grid.ColumnModel自适应宽度去除右边空白
- renderer:function参数介绍
- Ext.grid.ColumnModel——表格列模型组件
- 快速掌握grep命令及正则表达式
- IOS Quartz 各种绘制图形用法---实现画图片、写文字、画线、椭圆、矩形、棱形等
- mysql查询今天、昨天、上周
- 修改devXpress ribbonForm左上角的DX图标
- iOS 遇到的小知识点总结
- Ext.grid.ColumnModel renderer 参数介绍
- 关于lua中显示绝对时间和相对时间
- linux 下C调用Python 模块
- spring框架学习(三)junit单元测试
- Junit简单使用(一 )
- 将10.2.0.5升级到11.2.0.4
- 关于cell中分割线的顶格显示的问题(两种解决办法)
- spring框架学习(二)依赖注入
- Qt调用外部程序QProcess