XUL:Tree
Editable Tree
The following properties and methods are added for editable tree support. To enable editing of a tree, set the editable attribute on the <tree> to true.
For content trees, the editable attribute may be set to false on a specific <treecell> to disable editing of that cell.
RDF Built trees do not currently support editing.
Editable trees do not work in Firefox 2, they work in Firefox 3 though.
Properties
- editingRow
- The integer row index of the cell currently being edited, or -1 if no cell is being edited.
- editingColumn
- The TreeColumn of the cell currently being edited, or null if no cell is being edited.
Methods
- startEditing ( row , column )
- Start editing a cell at a given row index and column.
- stopEditing ( shouldAccept )
- Stop editing a cell. If shouldAccept is true, the cell label is changed to the edited value. If shouldAccept is false, the cell label is not changed.
Usage
<tree editable="true" flex="1">
<treecols>
<treecol id="sender" label="Sender" flex="1"/>
<treecol id="subject" label="Subject" flex="2"/>
</treecols>
<treechildren>
<treeitem>
<treerow>
<treecell label="joe@somewhere.com"/>
<treecell label="Top secret plans" editable="false"/>
</treerow>
</treeitem>
</treechildren>
</tree>