var data = [{
"description": null,
"file": "/release.txt",
"name": "Test7",
"ParentId": null,
"path": "site.net",
"id": 6,
"release": "1.0",
"created": "2016-04-26 14:56:42"
}, {
"description": null,
"file": "/release.txt",
"name": "Test5",
"ParentId": null,
"path": "site.net",
"id": 4,
"release": "1.0",
"created": "2016-04-26 14:56:40"
}, {
"description": null,
"file": "/release.txt",
"name": "Test1",
"ParentId": 7,
"path": "site.net",
"id": 1,
"release": "1.0",
"created": "2016-04-26 14:49:07"
}, {
"description": null,
"file": "/release.txt",
"name": "Test2",
"ParentId": 7,
"path": "site.net",
"id": 2,
"release": "1.0",
"created": "2016-04-26 14:49:09"
}, {
"description": null,
"file": "/release.txt",
"name": "Test4",
"ParentId": 1,
"path": "site.net",
"id": 3,
"release": "1.0",
"created": "2016-04-26 14:56:39"
}, {
"description": null,
"file": "/release.txt",
"name": "Test6",
"ParentId": 1,
"path": "site.net",
"id": 5,
"release": "1.0",
"created": "2016-04-26 14:56:41"
}, {
"description": null,
"file": "/release.txt",
"name": "Test8",
"ParentId": 4,
"path": "site.net",
"id": 7,
"release": "1.0",
"created": "2016-04-26 14:56:43"
}, {
"description": null,
"file": "/release.txt",
"name": "Test9",
"ParentId": 4,
"path": "site.net",
"id": 8,
"release": "1.0",
"created": "2016-04-26 14:56:44"
}];
$scope.tree_data = $TreeDnDConvert.line2tree(data, 'id', 'ParentId');
How can I fix the problem please ? How to reorganize my array ? My data is provided by my database