TreeView component with active checkboxes

Good afternoon,

I request your assistance with the following issue. I am using the treeview component in Angular, in which I have the 'checked' property visible. The data assigned to 'treeData' is an array that comes from the database, and it has the 'isChecked' property with the following values: 'true', 'false', and 'mixed'. These values are the same as the ones interpreted by the component for the tree nodes. I would like the node states to be rendered according to how they come from the database, but it is not working that way. Instead, all the nodes are being rendered as checked, even if the 'isChecked' property from the database is not 'true' for each element of the data. Below, I will send an image of how the information is stored in the database and how it is displayed in the tree.


1 Reply

SA SureshRajan Alagarsamy Syncfusion Team July 7, 2023 12:50 PM UTC

Hi Vicky,


We have reviewed your query and understand that you are experiencing an issue with the "isChecked" field in the TreeView component. We have prepared a sample on our end using hierarchical data, where we have declared the "isChecked" field as a “field property and included it in the TreeView's hierarchical data source for certain nodes. Based on the value of the "isChecked" field, the checkboxes for each node are rendered correctly, indicating whether they are checked or unchecked.


We have shared a sample for your reference.


Sample : https://stackblitz.com/edit/angular-b2o9tv?file=src%2Fapp.component.ts


If we have misunderstood your requirement, we kindly request you to provide us with further details about the issue you are facing or replicate the issue in the provided sample. This will help us validate your query further and provide you with a prompt solution.


Regards,
Suresh.


Loader.
Up arrow icon