I've found that using the ui plugin breaks the links for the tree nodes. This isn't anything new, I've found references to this problem elsewhere. The first cause was a problem with v1.6 of the jquery validation plugin. I'm not using that plugin, so that can't be the cause.
I also found a good posting describing a few ways of adding the jstree-clicked class to the <a>
tag. That looked promising, but when I tried it I didn't notice any difference. Here is a very simple example:
<div id="treediv">
<ul>
<li id="page1"><a href="http://www.yahoo.com" class="jstree-clicked">YAHOO!</a></li>
</ul>
</div>
<script type="text/javascript" class="source">
$(function () {
$("#treediv")
.jstree({
"core" : {
"animation" : 0
},
"themes" : {
"theme" : "classic"
},
"plugins" : [ "themes", "html_data", "cookies", "ui" ]
});
});
</script>
If I take out the ui plugin, then clicking the link takes me to yahoo.com as expected. Does anyone have any ideas?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…