href and "ui" plugin

1,051 views
Skip to first unread message

bartroby

unread,
Oct 30, 2010, 11:16:23 AM10/30/10
to jsTree
hi,

with "ui" plugin enabled, the "href" in the tag <a> of each node is
not fired.
Disabling the "ui" plugin i can see the link related to the "href"
clicked.

I need both the link working right and the "ui" plugin in order to
highlight the selected node.

How can i solve this problem?

Thanks

vakata

unread,
Oct 31, 2010, 4:45:55 PM10/31/10
to jsTree
Simply bind to the "select_node.jstree" event and do what you need
with the link:

$("#tree")
.jstree(/* your config here */)
.bind("select_node.jstree", function (e, data) {
var href = data.rslt.obj.children("a").attr("href"); // this is
the link
// you can follow it:
document.location.href = href;
// or load it somewhere
$("#the_div").load(href);
})

If you go with changing the document location, you will need to
reselect it once the page load is done ... but be careful not to get
in a loop - this is discussed in the FAQ on jstree.com ... and here in
the groups.

Kindest regards,
ivan
Reply all
Reply to author
Forward
0 new messages