【问题标题】:I want to select rows(checkbox) in ag-grid based on a condition我想根据条件在 ag-grid 中选择行(复选框)
【发布时间】:2020-09-08 23:29:00
【问题描述】:

基本上,有一个按钮在单击时会获取一个数组。我需要将该数组与现有的 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
        },
]

【问题讨论】:

    标签: checkbox angular7 ag-grid-angular


    【解决方案1】:

    你累了吗isRowSelectable()。它总是会根据某些条件进行行选择。

    Is Row selectable

    【讨论】:

      猜你喜欢
      • 2020-09-12
      • 2018-04-10
      • 2018-09-18
      • 2019-04-22
      • 2016-01-21
      • 2020-11-02
      • 2018-05-20
      • 2017-03-20
      • 2018-10-27
      相关资源
      最近更新 更多