Hi
I use the angular scheduler, the resources are structured in a tree.
But for example on a button click a want to refresh the child nodes of a parent.
Is this possible?
Already tried the load children but this ends up in an Id collision because the original children are still there.
Then I tried to first use the removeChild method but that didn't work. Should the children also visually be gone in the scheduler when using removeChild?
What is the best approach to do this?
Kind regards
jmeire
Support Forum
What's the reason for the need of a manual refresh? Has the data changed? If data changes the view is refreshed automatically.But for example on a button click a want to refresh the child nodes of a parent.
On a separate topic, looks like your trial is expired so we'll need you to license our software to continue receiving support. Please reach out to sales [at] bryntum to arrange this.
Hi
A license is currently being requested. Thank you for the support so far, it has been a great help!
The reason for the manual refresh is sorting and filtering, but the sorting and happens in the back end of my application because it is complex and depends on multiple entities that are not included in the data that we uses for the resources of the scheduler tree.
So for example if i click a 'filter' button --> this should completely refetch the children.
Load children requires the children to be removed first I guess because otherwise there will be an Id collision.
A license is currently being requested. Thank you for the support so far, it has been a great help!
The reason for the manual refresh is sorting and filtering, but the sorting and happens in the back end of my application because it is complex and depends on multiple entities that are not included in the data that we uses for the resources of the scheduler tree.
So for example if i click a 'filter' button --> this should completely refetch the children.
Load children requires the children to be removed first I guess because otherwise there will be an Id collision.
Okay then I must do something wrong because I get an Id collision when refreshing children.
I added an example project, and a preview of the issue as a gif.
When you click the refresh children button, this triggers a loadChildren of the expanded nodes.
LoadChildren should handle this correctly but it triggers an id collision error.
How can I handle the refresh of the children correctly?
Example project: Thanks in advance!
I added an example project, and a preview of the issue as a gif.
When you click the refresh children button, this triggers a loadChildren of the expanded nodes.
this.resourceStore.loadChildren(resource);
How can I handle the refresh of the children correctly?
Example project: Thanks in advance!
Hi!
Try removing children before you load them again otherwise you would receive Id collision errors because same rows are added twice.
Also save/load expanded/collapsed row states before/after this operation.
See sample code for this here
viewtopic.php?p=69107#p69135
Try removing children before you load them again otherwise you would receive Id collision errors because same rows are added twice.
if (resourcesToBeSorted && resourcesToBeSorted.length > 0) {
resourcesToBeSorted.forEach((resource: any) => {
this.resourceStore.remove(resource.children);
this.resourceStore.loadChildren(resource);
});
}
Also save/load expanded/collapsed row states before/after this operation.
See sample code for this here
viewtopic.php?p=69107#p69135
Created issue to get it fixed
https://github.com/bryntum/support/issues/491
https://github.com/bryntum/support/issues/491