I have another question - I am trying to load dynamically for Webix tree-
This is the code I currently have:
//For ROOT
- url:‘api/fulltree/getChildrenOfNode?nodeType=root’,
// For [sub] directories - on:{
- onDataRequest: function (id) {
-
webix.message("Getting children of " + id);
-
this.parse(
-
webix.ajax().get('api/fulltree/getChildrenOfNode?
- nodeId=’+id+’&nodeType=’+type).then(function(data) {
-
);return data = data.json(); })
-
}return false; }
As you can see, on line 7, I will need to include a type reference to the API I have for returning the subdirectories. However, I am unable to do so since I can only use the ‘id’ parameter for onDataRequest. My website previously used a jstree and their function looked like “function(Node node)” and I could reference the id using “node.id” and the type as “node.type”.
My JSON looks like :
0:
id:“5b29972ae84a74665fb473ea”
“type”: “space”,
value:“vibhav”
webix_kids:false
1:
id:“5b2c0b83b64a35912886b207”
type:“collection”
value:“vibhav”
webix_kids:false
2:
id:“5b2b183bb64a7d2cad311baf”
type:“collection”
value:“lol”
webix_kids:false
3:
id:“5b2af7c0b64a7d2cad311b69”
type:“collection”
value:“knknnk”
webix_kids:true
How could I reference the ‘type’ in the API call.
Any help from the technical team will be greatly appreciated. I really want to use Webix.