This is a migrated thread and some comments may be shown as answers.

Is parentId field required to be null?

1 Answer 208 Views
TreeList
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 29 Apr 2016, 02:34 PM

I'm creating a TreeList from remote data that will be defined by the end user and that I won't have control over.  When I receive data from the data source where parentId = 0, no data loads.  When I receive data where parentId = null (for root nodes), the values load successfully.

So...is it required that the parentId value for root nodes be null or is there a flag I can set for the parentId field that says something like "consider nodes whose parentId = 0 to be a root node"?

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Kiril Nikolov
Telerik team
answered on 02 May 2016, 08:11 AM
Hi,

There is no need for the parentId to be null in order to bind the TreeList. In your case you can set something like:

 fields: { parentId: { defaultValue: 0 } }

and it should work.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
TreeList
Asked by
Matt
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Share this question
or