Markus, Roman, (and the rest of the clever brains!),
I didn't manage to make the binding on the *checknode.jstree" event
work.
I neither have the impression that I forgot something. To be sure I
paste my source code here.
<link rel="stylesheet" type="text/css" href="_http://
static.jstree.com/layout.css" />
<script type="text/javascript" src="javascripts/jquery.js"></
script>
<script type="text/javascript" src="javascripts/
jquery.cookie.js"></script>
<script type="text/javascript" src="javascripts/
jquery.hotkeys.js"></script>
<script type="text/javascript" src="jquery.jstree.js"></
script>
</head>
<body>
<script type="text/javascript" class="source">
$(function () {
$("#demo1").jstree({
"json_data" : {
"data" : [
{
"attr" : { "id" : "Node_395" },
"data" : "A node",
"children" : [
{
"attr" : { "id" : "Node_3" },
"data" : "Child 1"
},
{
"attr" : { "id" : "Node_4" },
"data" : "Child 2"
}
]
},
{
"attr" : { "id" : "
li.node.id" },
"data" : {
"title" : "Long format demo",
"attr" : { "href" : "#" }
}
}
]
},
"plugins" : ["themes", "json_data", "cookies",
"ui", "checkbox"]
});
});
$("#demo1").bind("check_node.jstree", function (e, data){
alert("check_node event is going to be fired:");
console.log('ID of checked node:' +
data.rslt.obj.attr('id'));
console.log('ID of parent node:' +
(data.inst._get_parent(data.rslt.obj)==-1?'checked node is
root!':data.inst._get_parent(data.rslt.obj).attr('id')));
console.log('ID of child-nodes:');
data.rslt.obj.find('li').each(function(i){
console.log( 'ID child('+i+'):'+$
(this).attr('id'));
});
});
</script>
<div id="demo1" class="demo"></div>
</body>
</html>
Can you help by taking a look?
I checked: the plugins too, did I forget something? Or do the plugins
must be in a certain order?