Hello
I have dataset where parentId for root item is empty string. In this situation the tree does not displays ("No records available").
How to set default value for parentId field just like here: https://www.telerik.com/forums/is-parentid-field-required-to-be-null ?
Regards
4 Answers, 1 is accepted
Hi Grzegorz,
Thank you for the provided feedback.
The root item should have a null or undefined for its parentId property in order for the TreeList to function properly. Indeed, currently there isn't an option to set the default value of the root element's parentId. But that could be achieved by adjusting manually the data before it is passed to the TreeList.
We will also proceed with updating our documentation accordingly to add that information about the root level parentId property. Thank you for pointing our attention to that. I have also updated your account Telerik points for the provided feedback.
Please let us know in case we are missing something or if any further information or assistance is required for this case. Thank you.
Regards,
Svetlin
Progress Telerik
Our thoughts here at Progress are with those affected by the outbreak.
Thank you for the information. But the option to set a default value for the parentId field would be much better. Think about it.
Regarding the TreeList: field values in the tree do not update automatically. Why ?
For example, if I attach the same dataset to grid and tree and change the value of the record in the dataset, it will be visible in the grid, but not in the tree.
Hi Grzegorz,
About the default value, indeed that is a possible update that we can add to the TreeList. That is why I logged a new feature request in our public Feedback Portal:
that will allow our clients to vote for such feature and we will be able to track its demand which will help us to add its implementation to our future development plans accordingly.
About the second part of the message, the TreeList is implemented to work with On-Push change detection strategy (as opposed to the Grid) which is why when updating one of its items it won't be automatically updated as it wouldn't be re-rendered. What should be done in order to update the view is to call its dedicated updateView() method or bind the TreeList to an Observable which returns a new data set whenever an item property is updated. Here is an example demonstrating the the usage of the updateView() function:
https://stackblitz.com/edit/angular-wnrkrr-6j4via?file=app%2Fapp.component.ts
I hope this helps. Please let us know in case any further information is required for this case. Thank you.
Regards,
Svetlin
Progress Telerik