Got this working by doing this:
(I'm using async by the way, not sure how it will work without async)
- create overlay styles with the names prefixed with "overlay-"
Example:
/* define an overlay called new */
.tree .tree-mytree li div.overlay-new
{
background: no-repeat url(../../../images/new_overlay.png);
}
/* used by all overlays */
.tree .tree-mytree li div.overlay
{
position: relative;
z-index: 500;
left: -2px;
top: 6px;
width: 8px;
height: 8px;
}
- in the json data, specify the overlay classes that you would like
use for the node
- create onload callback and add a div element before the a element
for each node with the specified classes:
onOpen: function(NODE, TREE_OBJ) {
var _this = this;
//Find all class names contained in the node that are prefixed
with overlay-* and add
//a div element before the a element that has these overlay
classes.
var rxOverlay = new RegExp(/(?:overlay-\w+)+/);
$(NODE).find("ul > li").each(function() {
var m = rxOverlay.exec($(this).attr("class"));
if (m != null) {
var c = "overlay ";
for (i = 0; i < m.length; i++) {
c += m[i] + " ";
}
$(this).children("a:first").before("<div class='" + c +
"'></div>");
}
});
return true;
}
Thats it!
On May 14, 7:20 pm, Shandem <
s...@thefarmcreative.com.au> wrote:
> This is sort of why i posted this question:
http://groups.google.com/group/jstree/browse_thread/thread/905b801dab...