extjs RowExpander



var expander = new Ext.ux.grid.RowExpander({
tpl : new Ext.XTemplate('<div class="x-grid-group-title" style="margin-left:10%">'
+ '<table class="displayTable">'
+ '<thead><tr><th>审核单位</th><th>审核人员</th><th>审核时间</th><th>审核状态</th></tr></thead>'
+ '<tpl for="auditHistory"><tr>' + '<td><tpl for="auditCorp">{name}</tpl></td>'
+ '<td><tpl for="auditUser">{cnName}</tpl></td> '
+ '<td>{auditDate:this.getAuditDate}</td><td>{status:this.getStauts}</td>' + '</tr>'
+ '</tpl>' + '</table>' + '<table class="displayTable">' + '<thead>'
+ '<tr><th>收费项目</th><th>收费金额</th></tr>' + '</thead>' + '<tpl for="details"><tr>'
+ '<td><tpl for="feeType">{name}</tpl></td>' + '<td align="right">{chargesMoney}</td> '
+ '</tr>' + '</tpl>' + '</table>' + '</div>', {
getAuditDate : function(d) {
if (d)
return Date.parseDate(d, "Y-m-d\\TH:i:s").format("Y-m-d H:i:s");
return "";
},
getStauts : function(val) {
switch (val) {
case 0 :
return "同意";
case 1 :
return "退回";
default :
return "";
}

}
}),
lazyRender : true,
enableCaching : false,
toggleRow : function(row) {

if (typeof row == 'number') {
row = this.grid.view.getRow(row);
}
if (!Ext.fly(row).hasClass('x-grid3-row-collapsed')) {
this.collapseRow(row);
return;
}
var store = this.grid.store;
var record = this.grid.store.getAt(row.rowIndex);
var _this = this;

var mark = new Ext.LoadMask(Ext.getBody(), {
msg : 'Loading data...',
removeMask : true
});
mark.show();
Ext.Ajax.request({
url : './notecollection!show.html',
params : {
'id' : record.id
},
method : 'POST',
callback : function(option, success, response) {
var rt = Ext.util.JSON.decode(response.responseText);
if (success && rt.success) {
record.set("details", rt.details);
record.set("auditHistory", rt.auditHistory);
_this.expandRow(row.rowIndex);
} else {
handgoajax.ajaxError(rt.msg);
}
mark.hide();
}
});
}

});
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值