When enabling the showSelectAll option in a checkbox column on the TreeList component, a checkbox is rendered with the TreeListSelectAllCheckboxDirective. In its constructor, this directive includes some logic that causes the TreeList to instantiate a new ViewCollection every time a selection change occurs. However, the call to ViewCollection.loadView() does not pass the service responsible for determining expanded nodes, so the default fallback (which returns true for all nodes) is used.
Unnecessary and potentially expensive backend calls
Performance degradation, especially with large datasets
Inefficient "select all" logic that does not respect the current loaded/visible state
This behavior appears to ignore the fact that TreeList is configured for remote data binding with lazy-loaded children.
showSelectAll should only evaluate the currently loaded and visible items
fetchChildren() should not be called for every node
Integration with remote/lazy-loaded data should be respected
Update TreeListSelectAllCheckboxDirective to properly integrate with the expanded node detection logic or allow injection of a custom service.
Provide an override or callback to control the behavior of the "select all" checkbox manually in remote scenarios.
Configure a TreeList with hasChildren and children to fetch child nodes lazily.
Enable selection with checkbox column and showSelectAll: true.
Click any checkbox inside the TreeList.
Observe that fetchChildren() is triggered for all nodes, not just expanded ones.
Open console and click on the first cell.
https://stackblitz.com/edit/angular-e2ai4pjx?file=src%2Fapp%2Fapp.component.ts,angular.json