-
Notifications
You must be signed in to change notification settings - Fork 78
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
SohoTreeComponent - Children property is undefined when tree is multi select. #1690
Comments
@mdevale Can you just attach a zip with the tree-service.demo.ts updated and ready to drop in? I cant seem to make the code you mentioned compile. |
Im not too sure whats happening here but i see the point. I do get this error...
But it somehow still runs. Also i was thinking this might be a EP issue so tried this example in EP
Notice i pull the setttings.dataset. I cant seem to get this example to run and test that in NG. Maybe that helps tho if you change the example to use |
Yes issue with EP. After loading tree, children property is there in dataset after statement self.syncDataset(); but after self.initSelected() children property does not exist in dataset. Please see attached screenshot. Issue with self.syncNode(a); statement in setNodeStatus() method which is being called from initSelected() method. If we comment this line, it works fine but i am not sure is this correct resolution? |
@tmcconechy you can pull the fork "mdevale/enterprise-ng" and run. Then browse tree-dynamic page and click on Expand All button. See console output. "Node Two" has children's but you can't see in tree dataset. |
I think the problem might be in syncNode (which is called view initSelected) as you said. We shouldnt comment out the line, should try and make sure syncNode will copy the children over as well. Maybe something here..
Can you move this to EP please @clepore ? |
it is copying children but it is deleted in subsequent code to code snippet mentioned by you in above comment.
|
Ok makes sense - then maybe we just move the copy to after that action so it gets copied on. Did you want to make a PR? |
This is also not resolving the issue. |
Found one more scenario. If tree is not multi select, on expanding node it's children property get's undefined. Please find attached screenshot. Steps to reproduce:
|
@deep7102 wonder if your recent fix fixes this. Can you test this and let me know? |
I had another issue with regular tree component while using ids-enterprise-ng v7.1.0(ids-enterprise v4.28.0). When a node is selected, its children disappear from My issue:
Expected Behaviour: The selected node should have children in the tree.dataset. QA may add a test for this scenario to verify in their testing. cc @karinthulin |
Describe the bug
When getting tree dataset, children property of tree node who has children's before assigning dataset to tree is undefined when tree is multi select.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
If tree node has children then children property of that node should not be undefined.
Version
Screenshots
Platform
Additional context
Put below code in tree-source.demo.ts to make tree multi select.
treeOptions: SohoTreeOptions = { hideCheckboxes: true, selectable: 'multiple' };
ngOnInit() { this.tree.options = this.treeOptions; }
Define ngAfterViewInit in tree-source.demo.ts as below
ngAfterViewInit() { const data = this.demoData.getRootTreeNodes(); console.log('Assigned Dataset: ' + JSON.stringify(data)); this.tree.dataset = data; console.log('Dataset from tree: '); console.log(this.tree.dataset); }
Change ROOT_NODE in tree-data.demo.ts as below
private ROOT_NODE: SohoTreeNode = { 'id': 'Root ' + this.id++, 'open': true, 'text': 'Node 1', 'children': [ { 'id': 'Node 1' + '/1', 'text': 'Leaf ' + this.id++ }, { 'id': 'Node 1' + '/2', 'text': 'Node ' + this.id++, 'children': [] } ] };
The text was updated successfully, but these errors were encountered: