Is parentId field required to be null?

2 posts, 1 answers
  1. Matt
    Matt avatar
    78 posts
    Member since:
    Mar 2009

    Posted 29 Apr Link to this post

    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"?

     

  2. Answer
    Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 02 May Link to this post

    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!
     
  3. Kendo UI is VS 2017 Ready
Back to Top