Unplanned
Last Updated: 29 Jul 2025 09:22 by ADMIN
Svitlana
Created on: 22 Jul 2025 12:44
Category: TreeList
Type: Bug Report
0
TreeList showSelectAll Checkbox Triggers fetchChildren on All Items with Remote Data Binding

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.

Problem

As a result, every checkbox interaction triggers fetchChildren() for all nodes, even those that were never expanded or loaded. This leads to:

  • 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.

Expected Behavior

  • 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

Suggested Solutions

  1. Update TreeListSelectAllCheckboxDirective to properly integrate with the expanded node detection logic or allow injection of a custom service.

  2. Provide an override or callback to control the behavior of the "select all" checkbox manually in remote scenarios.

Steps to Reproduce

  1. Configure a TreeList with hasChildren and children to fetch child nodes lazily.

  2. Enable selection with checkbox column and showSelectAll: true.

  3. Click any checkbox inside the TreeList.

  4. Observe that fetchChildren() is triggered for all nodes, not just expanded ones.

StackBlitz repro:

Open console and click on the first cell. 

https://stackblitz.com/edit/angular-e2ai4pjx?file=src%2Fapp%2Fapp.component.ts,angular.json

 

1 comment
ADMIN
Zornitsa
Posted on: 29 Jul 2025 09:22

Hi Svitlana,

Thank you very much for the details provided.

By default, the select-all checkbox of the TreeList component triggers the loading of the child nodes when the checkChildren property of the CheckboxColumnComponent is set to "true". This is also stated in the following documentation article

However, after further testing, it appears that even after setting the checkChildren property to "false" in order to not trigger the additional loading, the fetchChildren callback is still called for the child nodes as well. 

Here is the StackBlitz example from your reply updated by setting checkChildren to "false":

With the above being said, there is indeed a bug with the checkChildren property of the CheckboxColumnComponent when showSelectAll is enabled. To be more comprehensive, the bug is related to the fact that setting the checkChildren property to "false" does not affect the behavior of the select-all checkbox, and clicking it still triggers the loading of child nodes.

You can track the status of the mentioned TreeList bug by following the current item and thus stay notified of any updates on its resolution process. As a small token of gratitude for reporting this unexpected behavior, I updated the Telerik points of your account.

We apologize for any inconvenience that the bug might have caused on your side.

Regards,
Zornitsa
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.