I added multiple selection column and it is now able to select/ deselect rows manually in PrimeNG Datatable.
What I added:
<p-column [style]="{'width':'38px'}" selectionMode="multiple"></p-column>
I am expecting to unselect this rows after clicking a button which is in another column of data table. Is there any way to select/deselect primeNG datatable programmatically?
4.2.4
4.3.0
You can access selected rows through selection
property:
<p-dataTable [value]="cars" [(selection)]="selectedRows">
Then when you click on the button, you just have to assign an empty array to selectedRows
:
this.selectedRows = [];
See working Plunker
Is that what you are looking for ?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With