开发中需求是统计选择的行数,所以要监控checkbox的选择事件包括表头的全选事件
遇到的问题就不赘述了
方案是监控grid的复选框和行加载时绑定事件
baseView: DBEN.controls.IGrid;
init() {
super.init();
let obj = this;
this.baseView.on("selectionchange",
function (rowModel, record, rowIndex, eOpts) {
var selections = obj.invoiceGrid.getSelectionModel().getSelection();
var selectionLength = selections.length;
obj.disSelectedIndex.setRawValue(selectionLength);
});
//行点击事件
this.control(this.view, {
gridInvoiceDetail: { rowclick: this.egpUpGridRowClick }
})
}
egpUpGridRowClick(grid, row) {
var selections = this.invoiceGrid.getSelectionModel().getSelection();
var selectionLength = selections.length;
this.disSelectedIndex.setRawValue(selectionLength);
}