The TreeList enables the user to select a single row or multiple rows and provides checkbox and row-click selection options.
To implement row selection:
As a result, the TreeList allows you to set the currently clicked item as selected. The
selectedField option represents a field inside the data collection which determines the rows that will render as selected.
The TreeList provides both checkbox and row-click selection options which can be applied to single or multiple records.
The checkbox selection enables the user to select a TreeList item by checking a checkbox and implements a master checkbox in the header that selects and deselects all items.
To configure the checkbox selection:
- Set a selection column by setting the
fieldproperty value of the column to be the same as the
selectedFieldvalue of the TreeList.
- Handle the
TreeListRowClickEventevents, and store the selected state of the rows in the state of the application.
- In the
rendermethod of the application, set the selected state for each TreeList data item to the its
selectedFieldfield (that is, the
updateFieldsfunction in the following example).
The following example demonstrates how to implement a multiple records selection both on row click and with checkboxes.