ParamQuery grid support forum

General Category => Help for ParamQuery Pro => Topic started by: switchautomation on November 06, 2018, 11:53:01 am

Title: Feature request: Use childstr function in treeModel
Post by: switchautomation on November 06, 2018, 11:53:01 am
Hi
It will be good to use  childstr function in treeModel which return field name with nested objects.
Please implement if it is possible
Thanks

Title: Re: Feature request: Use childstr function in treeModel
Post by: paramvir on November 07, 2018, 10:14:27 am
There is already eachChild() method API to iterate through all nested children of a node in the Tree()

https://paramquery.com/pro/api#method-Tree

Hope it helps.
Title: Re: Feature request: Use childstr function in treeModel
Post by: switchautomation on November 08, 2018, 05:58:39 pm
Thanks for answer
But I mean case when need need tree by different field names with child items.

for example, how to build tree for next object without modifying:

{
   id: 1,
   name: "name 1",
   level1: [{
      id: 2,
      name: "name 2"
   },{
      id: 3,
      name: "name 3",
      level2:[{
         id: 4,
         name: "name 4"
      },{
         id: 5,
         name: "name 5"
      },{
         id: 6,
         name: "name 6",
         level3:[{
            id: 7,
            name: "name 7"
         },{
            id: 8,
            name: "name 8"
         },{
            id: 9,
            name: "name 9",
         }]
      }]
   },{
      id: 10,
      name: "name 10"
   }]
}

Thanks