[FIXED] How to deselect Primeng Selection Table (TS)

Issue

I want to reset the selected rows to all deselect via TS. Resetting the table does not update the selected rows.

<p-table [value]="groups" [(selection)]="selectedgroups">

TS:

import { Table } from 'primeng/table';

@ViewChild(Table) dataTableComponent: Table;
selectedgroups = [];

resetTable() {
  this.dataTableComponent?.reset();
}

Solution

You can reset table by assigning empty value to selected-groups property

resetTable() {
        this. selectedgroups = [];
}

Answered By – Chellappan வ

Answer Checked By – Cary Denson (Easybugfix Admin)

Leave a Reply

(*) Required, Your email will not be published