primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Table component filters object issue when used with column toggle

Open Joebeurg opened this issue 1 year ago • 0 comments

Describe the bug

The table component does not update the object list for the filters when using a column toggle feature with multiselect component. When toggling a column or more to display in the table, it updates the table correctly, but when deselecting columns, the filters object in the table does not reflect the changes. The table only adds newly selected columns by pushing to the filters object, while removing a column by deselecting it using the multiselect component, the table's filters object still shows that column with its filter value and operator.

Attached are Stackbliz and a video demonstrating the issue.

Screencast From 2024-11-07 21-37-55.webm

Environment

Ubuntu 24.10 PrimeNG 17.18.11 Angular 18.0.2 and 18.2.10 MS Edge/ Chrome 130

Reproducer

https://stackblitz.com/edit/r4vgzs-gzakbb?file=src%2Fapp%2Ftable-column-toggle-demo.html

Angular version

18.2.10

PrimeNG version

17.18.11

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

20.18.0

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

When selecting or deselecting columns from a multiselect component, the filters object of the table should be updated to reflect the displayed column in use. The selected columns should be the only ones to be available in the filters object discarding the deselected/removed columns. Also, when a column has an applied filter, when that column is deselected, the filters object should not include it and it should reset it.

Joebeurg avatar Nov 07 '24 21:11 Joebeurg