I have posted a piece of code on Mozilla Dev site that demonstrates how to nest nodes in the XUL tree. I will also post it here:
<tree id="myTree" flex="1" hidecolumnpicker="false" seltype="single" class="tree">
<treecols id="myTree2-treeCols">
<treecol id="myTree2-treeCol0" primary="true" flex="2" label="Column A" persist="width" ordinal="1"/>
<splitter class="tree-splitter" ordinal="2"/>
<treecol id="myTree2-treeCol1" flex="1" label="Column B" persist="width" ordinal="3"/>
</treecols>
<treechildren>
<treeitem>
<treerow>
<treecell label="1"/>
<treecell label="a"/>
</treerow>
</treeitem>
<treeitem container="true" open="true"> <!-- Make sure to set container="true" -->
<treerow>
<treecell label="2"/>
<treecell label="b"/>
</treerow>
<treechildren>
<treeitem>
<treerow>
<treecell label="2a"/>
<treecell label="ba"/>
</treerow>
</treeitem>
</treechildren>
</treeitem>
</treechildren>
</tree>
Thanks for the code. It really helps me in developing Firefox toolbar.
ReplyDelete