jquery - jsTree opened node attributes... how to get? -


i new jstree , have problems getting attributes of nodes. here code...

var $mytree = $('#treediv').html(res).jstree({         ...options     }).on("loaded.jstree", function () {         $mytree.jstree('open_node', '#' + idtoopen, false, true);     });      $mytree.bind("open_node.jstree", this.onnodeopen);  function onnodeopen(event, data){...here want of attributes of opened node}; 

my nodes have structure

<li><a href='#' id='some guid' rel='some string' accesskey='some number'>title of node</a></li> 

now want retrieve id, rel , accesskey attribute values in onnodeopen function, how can that?

data.rslt.obj contains jquery extended version of node clicked:

so retrieve id:

var id = data.rslt.obj.attr("id") 

i prepared small jsfiddle shows in action:

http://jsfiddle.net/ak4ed/144/


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -