Im using p-tree component from primeng to display different cases. The display part without pre select is working fine. Now once i save this to DB and user opens the same data again i have to get the latest data from DB and preselect those fields in p-tree. So i use rest controller to get these selected values and add this to [(selection)] = "selectedColumns" in html.
I have also set the partialSelected to parent and childnode to true and Selectable of child node to true for those preselected node. But still my pre select doesnt show the checkbox. My html code looks like below.
<p-tree [value]="reportColumnList" selectionMode="checkbox" [(selection)]="selectedColumns"></p-tree>
My inspect element looks like the attached screenshot below.
the yellow highlighted ones are the original list and pre selected list. Original list has 3 parent and 1st parent with index '0' has 89 children as shown. the 4th children with index 3 is shown with arrow mark upward with columnName as 'Board Name'. The selected list as seen 'SelectedColumns' has only one parent with index '0' and 2 children. the 1st children with index '0' is the 4th children from the original list. You can see that partial Selected is 'true' and 'Selectable' true.
With these changes i expect the pre selection should work fine, but it wouldnt. Can someone let me know whats wrong with this. Thank you.
There seems to be an issue with PrimeNG TreeSelect component. When setting the selection for a tree programmatically the expected behavior is that this propagation would also take place, but it currently does not. And we have an open bug for similar issue on github: https://github.com/primefaces/primeng/issues/12714