jstree의 클릭 이벤트에서 해당 node의 데이터 가져오는 방법이다.
data.a는 트리에 data에 넣어준 특정 변수값.
1 2 3 4 5 6 | .bind('select_node.jstree', function(event, data){ var id = data.instance.get_node(data.selected).id; //id 가져오기 var type = data.instance.get_node(data.selected).type; //type 가져오기 var path = data.instance.get_node(data.selected).path; //paht 가져오기 var a = data.instance.get_node(data.selected).data.a; //data 에서 a 가져오기 }) | cs |
'jsTree' 카테고리의 다른 글
[jsTree]ajax로 jstree 생성 방법 (0) | 2016.09.01 |
---|