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 Not Updating Selection State on Parent Node #3665

Closed
jonatino opened this issue Aug 15, 2017 · 8 comments
Closed

Tree Not Updating Selection State on Parent Node #3665

jonatino opened this issue Aug 15, 2017 · 8 comments
Assignees

Comments

@jonatino
Copy link

jonatino commented Aug 15, 2017

[X] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Plunkr Case (Bug Reports)
https://plnkr.co/edit/TH3juN334bA1TjeByeBM?p=preview

Current behavior
Parent node does not get checked.

image

Expected behavior
If you push a child node to the selection array, it should reflect on the parent node as if the child node was clicked.

Minimal reproduction of the problem with instructions
https://plnkr.co/edit/TH3juN334bA1TjeByeBM?p=preview

I've also tried manually firing the change detector but that did not work either.

What is the motivation / use case for changing the behavior?
Inconsistent behaviour

Please tell us about your environment:
Windows 10

  • Angular version: 2.0.X
    4.3.3

  • PrimeNG version: 2.0.X
    4.1.2

  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
    ALL

  • Language: [all | TypeScript X.X | ES6/7 | ES5]
    ALL

@banejo
Copy link

banejo commented Aug 16, 2017

I ran into this bug as well, do you have any workarounds?

@jonatino
Copy link
Author

@banejo no workarounds right now unfortunately. Hopefully the PrimeNg tem can resolve this quickly (they are usually very fast).

@cagataycivici cagataycivici self-assigned this Oct 19, 2017
@cagataycivici cagataycivici added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working Status: Pending Review Issue or pull request is being reviewed by Core Team labels Oct 19, 2017
@cagataycivici cagataycivici added this to the 4.3.0 milestone Oct 19, 2017
@cagataycivici cagataycivici changed the title [Bug] PrimeNg Tree Not Updating Selection State on Parent Node Tree Not Updating Selection State on Parent Node Oct 19, 2017
@nkvaratskhelia
Copy link

I have the same problem.

Angular version: 4.4.6
PrimeNG version: 4.2.2

@mysiteptyltd
Copy link

I am also experiencing the same issue using PrimeNG version 4.3.0.

Can I also request that the following is applied:

  1. when all children have been selected - the parent is then selected
  2. when at least one, but not all, children have been selected - the parent is marked as partialSelection = true

I have been able to get the behaviour for #2 above by setting partialSelection = true on the parent when creating my TreeNode array, but this still feels like a workaround for something that the TreeTable should do out of the box.

Thanks

@jigneshkhatri
Copy link

Found a workaround for pre-selection of multiple check-boxes (programmatically) in primeng Tree. You can find working example here: https://github.com/jigneshkhatri/primeng-treenode-preselect

@cjones26
Copy link

Any word on when this is going to be fixed?

@cagataycivici cagataycivici removed this from the 5.FUTURE milestone Jan 15, 2018
@jscharett
Copy link

Seeing this same behavior in 5.2.3. I select a child and the parent show partially selected. Then set selectedNodes=[], which unselects the child, but parent remains selected.

Also, is there any way to get the partially selected parent to show in the selectedNodes array? Seems like it only shows "fully" selected nodes, and not partially selected.

@cagataycivici
Copy link
Member

cagataycivici commented May 31, 2018

Sorry you have to do it on your side by setting partial selected as true for pre-selection, it is too expensive if the component does it.

https://github.com/jigneshkhatri/primeng-treenode-preselect

@mertsincan mertsincan removed Type: Bug Issue contains a bug related to a specific component. Something about the component is not working Status: Pending Review Issue or pull request is being reviewed by Core Team labels Oct 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants