Closed aichingm closed 10 years ago
On http://mbraak.github.io/jqTree/examples/load_on_demand.html the example says the "first level of data" should look like
[ { label: 'Saurischia', id: 1, load_on_demand: true }, { label: 'Ornithischians', id: 23, load_on_demand: true } ]
Returning this from the server will fail. Jquery tries to parse the json and will call the "error" function in $.ajax() because the response is not a valid json file
please replace the example with
[ { "label": "node1", "children": [ { "label": "child1" }, { "label": "child2" } ] }, { "label": "node2", "children": [ { "label": "child3" } ] } ]
or add something like this to the error function:
if(console){ console.log("loading data from remote failed! is your json valid?"); }
thanks, Mario
Thanks a lot! I fixed the example in the dev branch.
dev
Thank you!
On http://mbraak.github.io/jqTree/examples/load_on_demand.html the example says the "first level of data" should look like
Returning this from the server will fail. Jquery tries to parse the json and will call the "error" function in $.ajax() because the response is not a valid json file
please replace the example with
or add something like this to the error function:
thanks, Mario