Hi team , search is working fine but am selected child node after clear the value entire parent all tree node selected how to resolve it . here am selected western America after I remove that search value then i see my tree its showing all selected in Australia. can you help on this issue
Here another one case is am searched parent node that time am selected parent value i need to push that all child node value in that array how we can achieve that
Regards,
Yuvi
Hi team ,
Am also getting same issue can you please help on this but another place expecting once am searching parent node I need child node also its not came this is one of the scenario for me. Please help on this issue
Hi Test,
Based on the shared details we can understand that you are trying to utilize Syncfusion TreeView component and facing an issue while performing search operation. We have achieved your requirement by making the below changes,
[Query: All the nodes are getting selected]
We have resolved your query by using the Syncfusion TreeView component’s autoCheck property. We kindly suggest you to set false for the autoCheck property, so that node you check will be checked and other nodes are prevented from getting checked. Refer the code changes below,
[default.html]
<ejs-treeview #treeviewObj id="default" [showCheckBox]='true' [fields]='field' (dataBound)="dataBounded($event)" [autoCheck]='false' (nodeChecked)="nodeCheck($event)"> </ejs-treeview> |
[Query: Getting the child nodes]
We can understand that you are trying to get the child nodes when their parent node is getting checked. We achieved it by using the TreeView component’s nodeChecked event, Kindly refer the code changes below,
[default.ts]
nodeCheck(args){ …. let checkedNodeData = this.listTreeObj.getTreeData(args.data[0].id); if (checkedNodeData[0].hasChild) { // get child nodes array here let childNodes = this.getChildNodes(checkedNodeData[0].id); } }
getChildNodes(parentId) { return this.localData.filter(node => (node as any).pid === parentId); } |
We have attached the sample for your reference,
Sample: https://stackblitz.com/edit/angular-tg9bew-rp3kwb?file=default.html,default.component.ts
Kindly check out the shared details and get back to us if you need further assistance.
Regards,
Jafar