Is parentId field required to be null?

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

    Posted 29 Apr 2016 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. 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
    Kiril Nikolov avatar
    2596 posts

    Posted 02 May 2016 Link to this post


    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.

    Kiril Nikolov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top