如何使用带有角度的ag-grid复选框

问题描述 投票:2回答:1

enter image description here

如何将checkbox值绑定到event.and如何访问相应的数据?

home.ts

 columns = [
 {
  field: 'reportingLocation',
  headerName: 'Reporting Location '
 },
 {
  field: 'country',
  headerName: 'Country Name'
 },
 {
  field: 'DEL',
  headerName: 'DEL',
  editable:true,
  headerCheckboxSelection: true,
  headerCheckboxSelectionFilteredOnly: true,
  checkboxSelection: true
 } ];

我有一个函数来获取DEL=TRUE的行

 deleteLocations(e) {
console.log(this.list);
e.preventDefault();
this.list
.filter((item: any) => {
  return !!item.DEL;
})
.map(item => {
  this.store.dispatch(new

 LocationAndResponsibilityActions.OnLocationDelete(item.location_Id));
  });  }

我无法访问DEL值,使用aggrid复选框选择的正确方法是什么?

angular checkbox ag-grid ag-grid-ng2
1个回答
0
投票

ag-grid有一些selection events,但听起来像(rowSelected)可能是你正在寻找的。它将对象作为param传递回来,该param包含行数据以及一些其他有用的属性。

Plunker

© www.soinside.com 2019 - 2024. All rights reserved.