Lulutho Mgwali
Lulutho Mgwali

Reputation: 903

How to deselect Primeng Selection Table (TS)

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();
}

Upvotes: 1

Views: 1889

Answers (1)

Chellappan வ
Chellappan வ

Reputation: 27293

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

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

Upvotes: 3

Related Questions