A column of a tree
. It displays the column header and holds the size and other information about the column. You can also place splitter
elements between the columns to allow column resizing. You should always place an id
attribute on a treecol
element to ensure that the column positioning is handled properly.
More information is available in the XUL tutorial.
This example shows a checkbox in the first column, requires the style below.
<tree flex="1" editable="true"> <treecols> <treecol label="Active" type="checkbox" editable="true"/> <treecol label="Name" flex="1" /> </treecols> <treechildren> <treeitem> <treerow> <treecell value="true"/> <treecell label="Alice"/> </treerow> </treeitem> <treeitem> <treerow> <treecell value="false"/> <treecell label="Bob"/> </treerow> </treeitem> </treechildren> </tree>
To make the checkbox visible on some platforms, the following styles need to be added to the stylesheet (see treecol.type). On Firefox 2.x and 3.x, all operating systems other than Mac OS X already use these styles by default. If targeting Firefox for Mac OS X, be sure to use these styles but include your own checkbox image. However, chrome://global/skin/checkbox/cbox-check.gif
is available in SeaMonkey on Mac OS X..
treechildren::-moz-tree-checkbox { /* unchecked checkbox treecells. This style MUST come before treechildren::-moz-tree-checkbox(checked) otherwise it won't take effect. */ list-style-image: none; } treechildren::-moz-tree-checkbox(checked){ /* css for checked cells. cbox-check.gif isn't available in Firefox 1, 2, and 3 on Mac OS X, so you should specify a URL to an image in your extension or elsewhere. */ list-style-image: url("chrome://global/skin/checkbox/cbox-check.gif"); }
For example:
crop
crop
attribute. An ellipsis will be used in place of the cropped text. If the box direction is reversed, the cropping is reversed.start
end
left
right
center
none
none
and the displayed text is larger than this maximum width, you may be able to use the max-width CSS property (or the maxwidth attribute) to override this size. For example, for a menuitem in a menu you can add the following CSS rule when you want to use the value none
:menupopup > menuitem, menupopup > menu { max-width: none; }
cycler
true
, then the column is a cycler column. In the case, clicking on a cell in the column will alternate its state between on and off. This is used, for example, in a mail window, for a column that indicates that the message is read or unread with a small mark in the cell. If the cycler attribute is not set, the cell is a regular text cell.dragging
true
if the column is being dragged. This attribute is set automatically; you shouldn't adjust it yourself.editable
type="checkbox"
. When the user double-clicks an editable cell, a text field appears in which the user can edit the contents of the cell.fixed
true
, the size of the column in the tree cannot be adjusted by the user. Any splitter
to either side will resize those columns while keeping the fixed column at a constant size. If false
or not specified, the user can adjust the size of the column, typically by dragging the column header with the mouse.hideheader
true
to indicate that the tree column header should be displayed without any column header styling. If you don't set a label
for that column either, the header is not displayed at all.ignoreincolumnpicker
true
, the column does not appear in the column picker.primary
true
, the treecol
will have indentation and twisties drawn to the left of it to indicate the hierarchy level of the rows. If no column has the primary attribute set to true
, the tree
may still contain nested rows, although no indication will be given to the user. The attribute also controls whether the column picker allows the user to deselect this column.sort
sortActive
true
for the column which should be sorted by default.sortDirection
sortResource
attribute to specify the sort key.
ascending
descending
natural
src
treecol
element use an image for the header instead of a label
. You cannot have both an image and a label displayed in the header. Set this to the URL of an image to appear on the tree column header. If this attribute is left out, no image appears and the label is used instead. The class treecol-image
must be used on the treecol
element for the image to appear. You should still specify a label
for use in the column picker if ignoreincolumnpicker
is not true and hidecolumnpicker
is not true on the tree
.type
checkbox
progressmeter
text
width
accessibleType
Inherited Properties |
The following class may be used to style the element. This class should be used instead of changing the style of the element directly since it will fit more naturally with the user's selected theme.
treecol-image
src
attribute.tree
, treecols
, treechildren
, treeitem
, treerow
, treecell
and treeseparator
.nsIAccessibleProvider