vendredi 22 mai 2020

I want to select rows(checkbox) in ag-grid based on a condition

Basically, there is a button which when clicked gets an array. I need to compare that array with existing ag-grid and if there is a match need to select the corresponding checkbox / rows. i.e.based on the combination. Ag-grid and the array that we receive from the button has common keys that needs to be compared.

Here, importExcel() gets an array on firing which is to be compared with the ag grid -

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 gridoptions

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



Aucun commentaire:

Enregistrer un commentaire