Tree table is not updating the new changes
i have done expandAll for the tree nodes
toggleNodeExpandState(node, isExpand, isForAllNodes) { node.expanded = isExpand; if (node.children && isForAllNodes) { node.children.forEach((childNode) => { this.toggleNodeExpandState(childNode, isExpand, isForAllNodes); }); } }
HTML : <p-treeTable #calTreeTable class="calibrationTreeTable" *ngIf="cVariableTree && cVariableTree.length>0" [value]="cVariableTree" selectionMode="multiple" [(selection)]="selectedNodes" [(contextMenuSelection)]="contextMenuNode" [contextMenu]="isEditable?cm:null" (dblclick)="editRows()" (onContextMenuSelect)="buildContextMenus($event)">
the expanded state is update in this.cVariableTree but its not refreshing/updating the tree. this.cVariableTree = [...this.cVariableTree];
when i add above line, it is refreshing. This is workaround but i would like to know the actual reason.
Please see the change detection section at the documentation.