I have api response data stucture like below. My data is dynamic and may be change. Structure of data has children. It may has any children in children that times of that is not determined.The last child has a leaf and its value is true but the leaf of others that are parents is true.
[
{
"Id": 16456,
"ParentId": null,
"Title": "Tehran",
"MapLayerGroupTypeId": "1",
"leaf": false,
"children": [
{
"Id": 16457,
"ParentId": "16456",
"Title": "water",
"MapLayerGroupTypeId": "1",
"leaf": false,
"children": [
{
"Id": 22334,
"MapLayerGroupId": "16457",
"Title": "water passages",
"leaf": true
}
]
},
{
"Id": 16458,
"ParentId": "16456",
"Title": "base",
"MapLayerGroupTypeId": "1",
"leaf": true,
"children": []
},
]
},
{
"Id": 16462,
"ParentId": null,
"Title": "",
"MapLayerGroupTypeId": "1",
"leaf": false,
"children": [
{
"Id": 16463,
"ParentId": "16462",
"Title": "title2",
"MapLayerGroupTypeId": "1",
"leaf": true,
"children": []
},
{
"Id": 16464,
"ParentId": "16462",
"Title": "title2",
"MapLayerGroupTypeId": "1",
"leaf": true,
"children": []
},
{
"Id": 16465,
"ParentId": "16462",
"Title": "title3",
"MapLayerGroupTypeId": "1",
"leaf": true,
"children": []
}
]
}
]
I wanna display it in tree view using ExtJs.