通过复选框选择获取选定的行?

时间:2019-10-05 10:19:38

标签: angular ag-grid

在我的列定义中,我有这个:

 {
        headerName: 'All',
        field: 'all',
        headerCheckboxSelection: true,
        headerCheckboxSelectionFilteredOnly: true,
        checkboxSelection: true,
        width: 40,
        maxWidth: 40,
        suppressFilter: true,
        cellStyle: params => {

          return { textAlign: 'center' }

        }
      },

但是当我按复选框选择时,我没有得到选中的行。任何建议我该怎么做,以使按复选框选择与行选择相同?

我正在从农业网格文档中使用它: https://www.ag-grid.com/javascript-grid-selection/

1 个答案:

答案 0 :(得分:2)

来自ag-grid Grid Events API

  

rowSelected行被选择或取消选择。

示例:

id