dkim18
asked on
JsTree loading data?
I am trying to use the JsTree v3.0.
This loads the data into the tree.
Q1) I also saw you can use the .ajax inside of above code.
What's the difference?
THis one use .ajax to request.
This loads the data into the tree.
$('#tree').jstree({
'core' : {
'data' : {
'url' : function (node) {
return node.id === '#' ?
'ajax_roots.json' :
'ajax_children.json';
},
'data' : function (node) {
return { 'id' : node.id };
}
}
});
Q1) I also saw you can use the .ajax inside of above code.
What's the difference?
THis one use .ajax to request.
$('#file_tree').jstree({
"plugins": ["json_data", "themes", "ui", "crrm", "dnd", "search", "contextmenu"],
"json_data" :
{
[quote] "ajax" :
{
"url" : "{{ url('components/tree/findall') }}",
[/quote] "data" : function (node) {
console.info("Nodes:",node);
return {
"operation" : "get_children",
"id" : node.attr ? node.attr("id").replace("node_","") : 1
};
}
}
}
})
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Let's assume that they are both coming from the web service.
What's the difference?