【发布时间】:2020-02-03 10:34:57
【问题描述】:
在我的列定义中,我有这个:
{
headerName: 'All',
field: 'all',
headerCheckboxSelection: true,
headerCheckboxSelectionFilteredOnly: true,
checkboxSelection: true,
width: 40,
maxWidth: 40,
suppressFilter: true,
cellStyle: params => {
return { textAlign: 'center' }
}
},
但是当我通过复选框进行选择时,我没有得到选定的行。有什么建议可以做到这一点,以使通过复选框进行选择与行选择相同?
我在 ag 网格文档中使用这个: https://www.ag-grid.com/javascript-grid-selection/
【问题讨论】:
-
试试 gridApi.getSelectedRows()
-
但是当用户点击复选框时如何触发该事件?每次点击复选框时,我都需要抓住它并用它做一些事情
-
尝试网格回调事件 - (rowSelected)="rowSelected()"。参考 - ag-grid.com/javascript-grid-events
-
就是这样... tnx :)