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

Add key option to TreeNode API #7237

Closed
mertsincan opened this issue Feb 13, 2019 · 1 comment
Closed

Add key option to TreeNode API #7237

mertsincan opened this issue Feb 13, 2019 · 1 comment
Assignees
Labels
Type: New Feature Issue contains a new feature or new component request
Milestone

Comments

@mertsincan
Copy link
Member

If users have filter and checkbox selection features on Tree, they have to use 'key' option for these features to work correctly. The 'key' option is a unique value.

export interface TreeNode {
    label?: string;
    data?: any;
    icon?: any;
    expandedIcon?: any;
    collapsedIcon?: any;
    children?: TreeNode[];
    leaf?: boolean;
    expanded?: boolean;
    type?: string;
    parent?: TreeNode;
    partialSelected?: boolean;
    styleClass?: string;
    draggable?: boolean;
    droppable?: boolean;
    selectable?: boolean;
    key?: string;
}
@mertsincan mertsincan self-assigned this Feb 13, 2019
@mertsincan mertsincan added the Type: New Feature Issue contains a new feature or new component request label Feb 13, 2019
@mertsincan mertsincan changed the title Added key option to TreeNode API Add key option to TreeNode API Feb 13, 2019
@mertsincan mertsincan added this to the 7.1.0 milestone Feb 13, 2019
mertsincan added a commit that referenced this issue Feb 13, 2019
darkhelmet pushed a commit to weknowtraining/primeng that referenced this issue Mar 25, 2019
darkhelmet pushed a commit to weknowtraining/primeng that referenced this issue Mar 25, 2019
@kievsash
Copy link
Contributor

kievsash commented Feb 6, 2024

if user just used tree filter and then lazyLoaded some additional nodes - onNodeClick may not emit event on newly added nodes click since treeRef.value is not same as treeRef.filteredNodes anymore

https://github.com/primefaces/primeng/blob/16.9.1/src/app/components/tree/tree.ts#L1247
Solution: If add node.childre after filtering add them to respective node in treeRef.value as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: New Feature Issue contains a new feature or new component request
Projects
None yet
Development

No branches or pull requests

2 participants