Sunday, May 19, 2024
 Popular · Latest · Hot · Upcoming
76
rated 0 times [  78] [ 2]  / answers: 1 / hits: 38680  / 10 Years ago, sun, may 4, 2014, 12:00:00

Can you please tell me how how to get click event of row element of jstree ?
I make a demo of jstree in my fiddle .it is made in panel .you have to press open panel button to check panel



I want to click event of jstree element to get it id on click ?
For preparation of tree I have to press add test case button many times and then press open panel button.



here is my fiddle
http://jsfiddle.net/ZLe2R/6/



function addMenuItemsOfTestSuit(id){

var menuid = menu_ + id;
var ref = $('#tree').jstree(true);
alert('thank')
ref.create_node(#, {id : menuid, text : id});

ref.deselect_all();

}

More From » jquery

 Answers
5

Use this event listener:



$('#tree').on(select_node.jstree, function (e, data) { alert(node_id:  + data.node.id); });


Look jsTree API events for a list of events.



EDIT: created a fiddle: http://jsfiddle.net/y7ar9/4/


[#71188] Thursday, May 1, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
billt

Total Points: 608
Total Questions: 100
Total Answers: 87

Location: Cape Verde
Member since Fri, Nov 27, 2020
4 Years ago
;