jstree get highlight node
Most of the questions in jstree are about getting the selected node (and related id, etc). My current code for getting the selected node is:
viewerObj.bind("select_node.jstree",
function (e, data) {
var nodeId = jQuery.data(data.rslt.obj[0], "jstree").id;
//alert(nodeId);
var date = new Date();
...
);
But what I really want is not the selected node necessarily, but the highlight node (and parent id) so that I could capture the "create_node" event when it is triggered. How do I do that? I can't seem to find any code that does this correctly.
Here's the image of what the UI looks like:
I want to know how to grab "models". The select_node 开发者_运维知识库event capture the node that is selected (or "admin") in this case.
Update:
This does it:
.bind("hover_node.jstree",
function(e, data){
var nodeId = jQuery.data(data.rslt.obj[0], "jstree").id;
}
);
It capture the hover event and grabs the id associated with the node that was last hovered.
Update:
This does it:
.bind("hover_node.jstree", function(e, data){
var nodeId = jQuery.data(data.rslt.obj[0], "jstree").id;
});
It capture the hover event and grabs the id associated with the node that was last hovered.
精彩评论