This time all nodes are loaded from an external file. Notice that when you open the closed node nothing happens.
01.
$(
function
() {
02.
$(
"#async_html_1"
).tree({
03.
data : {
04.
opts : {
05.
url :
"async_html_data.txt"
06.
}
07.
}
08.
});
09.
});
By setting async : true
we are telling jsTree to request its data from the server everytime a closed node is opened (unless of course it is already loaded). If you want to modify the data sent to the server with each request take a look at the beforedata callback.
01.
$(
function
() {
02.
$(
"#async_html_2"
).tree({
03.
data : {
04.
async :
true
,
05.
opts : {
06.
url :
"async_html_data.txt"
07.
}
08.
}
09.
});
10.
});