Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tree: Allow filterBy to be a getter #6374

Closed
jacobtylerwalls opened this issue Sep 10, 2024 · 0 comments · Fixed by #6367
Closed

Tree: Allow filterBy to be a getter #6374

jacobtylerwalls opened this issue Sep 10, 2024 · 0 comments · Fixed by #6367
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@jacobtylerwalls
Copy link
Contributor

Describe the bug

As described in https://github.com/orgs/primefaces/discussions/2659, the <Tree> can already support a getter for the filterBy prop, as long as you work around the fact that .split() is called on it first. If we remove that assumption, we can get lazy lookups for filtering.

PR: #6367

Use case

My tree data has multiple labels in multiple languages. Depending on other reactive state, I might prefer some of the labels over the others. I'm already templating the tree rows myself, so now I want to control the best label for filtering. I don't want to recompute the whole tree when the other reactive state changes. I just want to control the filtering behavior with a getter.

Reproducer

https://stackblitz.com/edit/tree-filter-by-getter

PrimeVue version

4.0.1

Vue version

4.x

Language

TypeScript

Build / Runtime

TypeScript

Browser(s)

No response

Steps to reproduce the behavior

See attached fiddle. I'm using getterWrapped when I'd like to just use getter.

Expected behavior

No response

@jacobtylerwalls jacobtylerwalls added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Sep 10, 2024
@tugcekucukoglu tugcekucukoglu added this to the 4.1.0 milestone Sep 24, 2024
@tugcekucukoglu tugcekucukoglu added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Sep 24, 2024
tugcekucukoglu added a commit that referenced this issue Sep 24, 2024
@tugcekucukoglu tugcekucukoglu self-assigned this Sep 24, 2024
tugcekucukoglu added a commit that referenced this issue Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants