Dynatree - issue 204
HTML
<script src="http://dynatree.googlecode.com/svn/trunk/src/jquery.dynatree.js"></script>
<link rel="stylesheet" href="http://wwwendt.de/tech/dynatree/src/skin-vista/ui.dynatree.css">
<div id="tree"> </div>
<div id="info"></div>
<button id="btn1">Add cusom class to active node</button>
CSS
span.custom1 a { color: red; }
.custom1 span.dynatree-icon /* custom icon */
{
background-position: -48px -48px;
color: blue;
}
JavaScript
$(function(){
$("#tree").dynatree({
onActivate: function(node) {
$("#info").text("You activated " + node);
},
onRender: function(isReloading, isError) {
alert(isReloading);
$("#info").text("You activated " + isReloading);
},
children: [
{title: "Item 1"},
{title: "Folder 2", isFolder: true,
children: [
{title: "Sub-item 2.1"},
{title: "Sub-item 2.2"}
]
},
{title: "Item 3"}
]
});
$("#btn1").click(function(e){
var node = $("#tree").dynatree("getActiveNode");
$(node.span).addClass("custom1");
});
});