jquery - Access jstree metadata in double-click and ajax calls -


i'm using jquery jstree plugin create tree view. populated dynamically json data, each node contains metadata. when expand node able access node metadata , pass part of ajax call new json data. want access metadata when double-click node. can suggest code need insert code examples below?

$("#tree").jstree({      "json_data" : {         "ajax": {             "url": "/url",             "data": function(n) {                 // need metadata here             }         }     } });  $("#tree").delegate("a", "dblclick", function(e) {     // need metadata here }); 

i'm not sure doing in data function in instead of delegate can this.

$('#tree').bind("select_node.jstree", function(event, data){ console.log(data.rslt.obj.data('jstree')); //data.rslt.obj.data('jstree') contain metadata have set }); 

Comments