详细

来源:互联网 发布:陶瓷击穿电压算法 编辑:程序博客网 时间:2024/04/28 07:58
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;
}

2.6.1. 自动行号

只需要在cm中加上一行,这一行不会与ds中的任何数据对应,这也告诉我们可以凭空制作列,哈哈。

在之前的例子上改啦。

var cm = new Ext.grid.ColumnModel([
{header:'NO.',renderer:function(value, cellmeta, record, rowIndex){
return rowIndex + 1;
}},
{header:'编号',dataIndex:'id'},
{header:'性别',dataIndex:'sex'},
{header:'名称',dataIndex:'name'},
{header:'描述',dataIndex:'descn'}
]);
原创粉丝点击