Ok, I understand the needs of an array, but when I put an array, I obtain nothing to the screen
Look at the code:
I have an ajx method from jquery to ask the server
J.ajax({
type: 'GET', // Le type de ma requete
dataType: "json",
url: '{PATH_TO_ROOT}/regate/?url=/ajax/tree', // L'url vers laquelle la requete sera envoyee
data: {
mode: mode // Les donnees que l'on souhaite envoyer au serveur au format JSON
},
success: function(data, textStatus, jqXHR) {
J('#treev').tree('loadData', data);
//var donnee= jqXHR.responseText;
//J('#treev').tree('loadData',donnee);
},
error: function(jqXHR, textStatus, errorThrown) {
// Une erreur s'est produite lors de la requete
alert('Echec de la requete');
}
});
My server give me a jsonresponse. With firebug the data contains:
data Object { id=1, text="node1", state="closed"}and the jqXHR.responseText contains:
responseText "{"id":1,"text":"node1","state":"closed"}"If I use
J('#treev').tree('loadData', data);
I obtain no display in the treeview although data is an array !
If I use
var donnee= jqXHR.responseText;
J('#treev').tree('loadData',donnee);
I obtain "a too much recursion" error and a lot of "undefined" in the treeview