我想根据条件在ag-grid中选择行(复选框)

时间:2020-05-22 07:17:47

标签: checkbox angular7 ag-grid-angular

基本上,有一个按钮,单击该按钮可获得一个数组。我需要将该数组与现有的ag-grid进行比较,如果有匹配项,则需要选择相应的复选框/行。即基于组合。 Ag-grid和我们从按钮接收到的数组具有需要比较的公用密钥。

在这里,importExcel()在触发时会得到一个数组,该数组将与ag网格进行比较-

button class="btn btn-sm btn-secondary font-shrink pull-right" *ngIf='this.showUploadbtnSec' (click)="importExcel()" placement="top" 
                  tooltip="Upload now!" container="body">
                    <i class="lni-upload iconsize1"></i>
                  </button>

Ag-grid网格选项

   public gridColumnDefs = [
        {
            headerName: 'Portfolio Name',
            field: 'portfolioName',
            cellRenderer: 'agGroupCellRenderer',
            headerCheckboxSelection: true,
            headerCheckboxSelectionFilteredOnly: true,
            checkboxSelection: true,
            pinned: 'left',
            filter: true
        },
]

1 个答案:

答案 0 :(得分:0)

isRowSelectable()累了吗?它将始终根据某些条件进行行选择。

Is Row selectable