87,920
社区成员
发帖
与我相关
我的任务
分享
//重写了Ext.grid.GridView表格的样式,支持选择单元格,便于复制
if (!Ext.grid.GridView.prototype.templates) {
Ext.grid.GridView.prototype.templates = {};
}
Ext.grid.GridView.prototype.templates.cell = new Ext.Template(
'<td class="x-grid3-col x-grid3-cell x-grid3-td-{id} x-selectable {css}" style="{style}" tabIndex="0" {cellAttr}>',
'<div class="x-grid3-cell-inner x-grid3-col-{id}" {attr}>{value}</div>',
'</td>'
);
var bsm = new Ext.grid.CheckboxSelectionModel();
bacterinrecordqueryGrid = new Ext.grid.GridPanel({
title : '疫苗记录信息',
renderTo : 'bgrid',
height : '340',
store : bacterinrecordqueryStore,
// Align:'center',
sm : bsm,
columns : [bsm,
// 自动行号
new Ext.grid.RowNumberer({
header : "序号",
width : 40,
renderer : function(value, metadata,
record, rowIndex) {
return bacterinrecordrecord_start + 1
+ rowIndex;
}
}), {
header : '编号',
dataIndex : 'bacterinrecord.bacterinid',
width : 100,
// 隐藏列
hidden : true
}, {
header : '名称',
dataIndex : 'bacterinrecord.name',
width : 130
}, {
header : '数量',
dataIndex : 'bacterinrecord.count',
width : 100
}, {
header : '临界值',
dataIndex : 'bacterinrecord.threshold',
width : 100
}, {
header : '输入代码',
dataIndex : 'bacterinrecord.inputcode',
width : 100
}, {
header : '类型',
dataIndex : 'bacterinrecord.bacterintype',
width : 100
}, {
header : '单位',
dataIndex : 'bacterinrecord.bacterinunit',
width : 100
}, {
header : '属性',
dataIndex : 'bacterinrecord.bacterinproperty',
width : 100
}, {
header : '备注',
dataIndex : 'bacterinrecord.remark',
width : '100%'
}],
// width : '430',
tbar : [{
text : ' 新建 ',
tooltip : '新建',
iconCls : 'add',
handler : function() {
bacterinrecordadd();
}
}, '-', {
text : '修改',
tooltip : '修改',
iconCls : 'edit',
handler : function() {
bacterinrecordupdate();
}
}, '-', {
text : '删除',
tooltip : '删除',
iconCls : 'del',
handler : function() {
del(bacterinrecordqueryGrid,
bacterinrecordqueryStore,
"bacterin/del_Bacterinrecord.action",
'bacterinrecord.bacterinid');
}
}],
bbar : [{
xtype : 'paging',
pageSize : 10,
store : bacterinrecordqueryStore,
displayInfo : true,
beforePageText : "第",
afterPageText : "/ {0}页",
firstText : "首页",
prevText : "上一页",
nextText : "下一页",
lastText : "尾页",
refreshText : "刷新",
displayMsg : "当前显示记录从 {0} - {1} 总 {2} 条记录",
emptyMsg : "没有相关记录!",
doLoad : function(start) {
bacterinrecordrecord_start = start;
var o = {}, pn = this.paramNames;
o[pn.start] = start;
this.store.load({
params : o
});
}
}]
});