1. // 表格添加双击事件
grid.addListener('celldblclick',function(grid,rowIndex,colIndex,e){
if (colIndex == 8) {
addWindow = new Ext.Window( {
title : '投注号码详情',
width : 840,
autoHeight : false,
autoScroll :true,
height : 100,
resizable : false,
modal : true,
closeAction : 'hide'
});
var numberPanel = Joyveb.lotman.customer.js_showTzNumber.show(grid.store.getAt(rowIndex).get('wagerdata'));
addWindow.add(numberPanel);
addWindow.show();
}
});
2.function GridSum(grid) {
var wonBoards = 0;
grid.store.each(function(record) {
wonBoards += Number(record.data.bonus);
});
var n = grid.getStore().getCount();// 获得总行数
var p = new Ext.data.Record({
seq: "",
gamename : "",
periodnum : "",
award : "合计",
awardcount : "",
perbonus : "",
bonus : wonBoards
});
grid.store.insert(n, p);// 插入到最后一行
}
3.{
header : '详情',
dataIndex : 'details',
align : 'center',
width : 100,
renderer : function(value, metadata, record, rowIndex,
colIndex, store) {
if (record.get("period") == '合计') {
return "";
} else {
var contentId = Ext.id();
function createGridButton() {
return new Ext.Button({
text : '票详情',
iconCls : 'select',
handler : function() {
createDetailViewWindow(record);
}
}).render(document.body, contentId);
}
var btn = createGridButton.defer(1, this,
[ contentId ]);
return ('<div id="' + contentId + '"/>');
}
},
sortable : false
}