What is the data format
See original GitHub issuei’m kinda of stuck here, and need some help in getting the tree displayed.
- I did play with jstree first, and load the following data correctly. I know the only thing matters is the text and state, but I need the rest of data there for other purpose.
[
{
"created": "",
"name": "/",
"type": "directory",
"size": 0,
"children": [
{
"created": "1422994495000",
"name": "homepage",
"type": "directory",
"size": 136,
"children": [
{
"created": "1422994489000",
"name": "carasole",
"type": "directory",
"size": 68,
"children": [],
"text": "carasole",
"state": {
"opened": true
}
}
],
"text": "homepage",
"state": {
"opened": true
}
},
{
"created": "1422994495000",
"name": "others",
"type": "directory",
"size": 204,
"children": [
{
"created": "1422993066000",
"name": "bc",
"type": "directory",
"size": 68,
"children": [],
"text": "bc",
"state": {
"opened": true
}
}
],
"text": "others",
"state": {
"opened": true
}
}
],
"text": "/",
"state": {
"opened": true
}
}
]
- I used the following line
<div js-tree ng-model="treeData" tree-events="ready:treeReady;create_node:createNodeCB"></div>
and monitored the treeReady so that i know the tree is loaded
-
I know the treeData is there, because I can print it {{ treeData }}
-
however my tree is not displaying, so i wonder what i did wrong. Btw i didn’t set any treeConfig. please help.
Issue Analytics
- State:
- Created 9 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Data Format - C3 AI
Data format is the definition of the structure of data within a database or file system that gives the information its meaning. Structured...
Read more >Data format - Wikipedia
Data format · Audio format, a format for encoded sound data · Video format, a format for encoded video data.
Read more >3 types of Data Formats Explained
The data format is said to be a kind of format which is used for coding the data. The data is coded in...
Read more >Data format Definition, Meaning & Synonyms
data format the organization of information according to preset specifications (usually for computer processing) ; date from belong to an earlier time ;...
Read more >What is a data format?
A data format is the arrangement of data fields for a specific shape. After you arrange data fields on a shape, you can...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
By the way, you can achieve this without recreating the tree. Declare all the configuration in an object, and provide an empty array for the treeData. Once your $http request is finished, push all the data that you need to the treeData array and don’t replace its reference. This will work for sure, as this is the right way to use it.
H jsfile.txt
i ezraroi, modified in the way u suggested to make empty array and pushed the response data but it failed to create child nodes and gives error while trying to open a parent node. treeCtrl: error from js tree - {“error”:“nodata”,“plugin”:“core”,“id”:“core_05”,“reason”:“Could not load node”,“data”:“{"id":"ajson1"}”}
my config and data to load initial tree is like this.Given some initial data to populate tree because it is not creating any node in other ways. vm.treeData = [ { id : ‘ajson1’, parent : ‘#’, text : ‘Simple root node’, state: { opened: false},children:true }, { id : ‘ajson2’, parent : ‘#’, text : ‘Root node 2’, state: { opened: false},children:true }, ];
I am getting data from http service like this:
var promise = ravensService.getChildren();
I am calling the follwing function on “open_node” event of jsTree.But before this event i am getting above error 😦 vm.openChildNode = function() { vm.treeData.push(data.data); };
I have tried all the stuffs and working on same from days but unable to find solution.I am using jsTree in Angularjs.Since i am new to this please help in this regard.Thanks in advance.PFA for Js.