使用时注意参数顺序位置:
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显示不正常
EXT中根据返回的grid中的状态列的内容来改变这一行显示的背景颜色
69、Ext.grid.ColumnModel类 ……… 58 70、Ext.grid.PropertyColumnModel类 … 59 71、Ext.grid.GridView类 …………… 59 72、Ext.grid.GroupingView类 ………… 60 73、Ext.grid.EditorGridPanel类 ……… 62 74...
var cm = new Ext.grid.ColumnModel({ columns: [{ id: 'common', header: 'Common Name', dataIndex: 'common', width: 220, // 使用上边定义好的别名 editor: new fm.TextField({ allowBlank: false }) ...
69、Ext.grid.ColumnModel类 ……… 58 70、Ext.grid.PropertyColumnModel类 … 59 71、Ext.grid.GridView类 …………… 59 72、Ext.grid.GroupingView类 ………… 60 73、Ext.grid.EditorGridPanel类 ……… 62 74...
表格的列信息由Ext.grid.ColumnModel定义 表格的数据存储器由Ext.data.Store定义,根据解析数据的不同,数据存储器可具体分为如下几种: JsonStore,SimpleStore,GroupingStore… 一个表格的基本编写过程: 1、创建...
本文实例讲述了JSP+EXt2.0实现分页的...var cm = new Ext.grid.ColumnModel([ new Ext.grid.RowNumberer(), sm, {header:'编号',dataIndex:'id',sortable:true}, {header:'名称',dataIndex:'name',sortable:true},
Ext.onReady(function(){ var cm = new Ext.grid.ColumnModel([ {header:'Id',dataIndex:'id'}, {header:'Name',dataIndex:'name'},
表格的列信息由类Ext.grid.Column(以前是由Ext.grid.ColumnModel定义)、而表格的数据存储器由Ext.data.Store定义,数据存储器根据解析的数据不同分为JsonStore、SimpleStroe、GroupingStore等。 下面
修改一个grid的ColumnModel和Store A.9.3. 动态为ds添加参数baseParams A.10. 有关tree的一些小问题 A.10.1. 如何选中树中的某个节点 A.10.2. 刷新树的所有节点 A.10.3. 如果取得json中自定义的属性 A.11. 如何使用...
表格的列信息由类Ext.grid.ColumnModel定义、而表格的数据存储器由Ext.data.Store定义,数据存储器根据解析的数据不同分为JsonStore、SimpleStroe、GroupingStore等。 我们首先来看最简单的使用表格的代码: 代码...
NULL 博文链接:https://mogen9999.iteye.com/blog/262819
1、Ext.grid.GridPanel 主要配置项: store:表格的数据集 columns:表格列模式的配置数组,可自动创建ColumnModel列模式 autoExpandColumn:自动充满表格未用空间的列,参数为列id,该id不能为0 stripeRows:表格...
ExtJS记录字段宽度顺序状态,当用户拖动字段,修改宽度、调整顺序时可以获取调整后的顺序、宽度,
jquery在这方面则正好相反,它的UI都以插件形式提供,可以需要什么就引用什么,... 一个grid包括一些行和列,在extjs里边,列由Ext.grid.ColumnModel来管理,我们来看看如何创建一个ColumnModel对象: 代码如下: var cm
代码如下: var cm = new Ext.grid.ColumnModel( [ new Ext.grid.RowNumberer({ header: “”, width: 20, align: ‘center’ }), { header: ”, align: ‘center’, dataIndex: ‘AccountAndRoseID’, width: 50, ...
extjs 4.0 Grid属性方法以及常用操作,板面属性和对象
为了解决这个问题需要在EditorGridPanel的ColumnModel中显示ComboBox的地方使用renderer属性,重新渲染,方法如下: 代码如下: //部门列表 var comboxDepartmentStore = new Ext.data.Store({ proxy: new Ext.data....
可以定制一个ListView,能够在列中插入图像、下拉框、可...然后,拖动Table, ColumnModel 和 TableModel到Form上,设置Table的ColumnModel 和 TableModel属性,添加Column到ColumnModel,添加Row 和 Cell到TableModel.