Yea, I've done this before. Unfortunately, it turned out to be about a million times more tricky than I realized going in, or I never would have bothered. Code that seems to work pefectly on simple examples utterly fails to capture the rich complexity that is actually required. Frankly, the nsITreeView interface was never meant to be implemented by mere mortals, or more than once.
Jan Varga set me straight, however, and ripped out all of that code and replaced it with a template that pulls data from the sqlite query processor. That made it dead simple. I believe he maintains (though that may be too strong a word) a patch to backport the feature to the 1.8 branch, if that's what you need.
Posted by db48x at March 22, 2008 10:10 PMThis sounds like a possible good candidate for FUEL perhaps?
Posted by Shawn Wilsher at March 23, 2008 4:02 AMI wrote the original hierarchical nsITreeView example submitted to XULplanet and still available at http://neil.rashbrook.org/primary.xul although you'll need to enable privileges to demonstrate it.
What's the deal with your propertyname attribute?
(From Alex: It's really just a convenience so that one can map a property of an object to a column in that row. The fallback is the cellGetter user data.)
Posted by Neil at March 23, 2008 12:17 PMThe tree-utils script that is a part of venkman take a little getting used to but is quite powerful when you need it:
http://mxr.mozilla.org/seamonkey/source/extensions/venkman/resources/content/tree-utils.js
Posted by Mossop at March 23, 2008 2:28 PM