XUL:treecol
Aus MDC
« XUL Referenz Startseite [ Beispiele | Attribute | Eigenschaften | Methoden | Verwandte Themen ]
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.
- Attribute
- crop, cycler, dragging, editable, fixed, hidden, hideheader, ignoreincolumnpicker, label, primary, sort, sortActive, sortDirection, src, type, width
- Eigenschaften
- accessibleType
- Stilklassen
- treecol-image
[bearbeiten] Beispiel
This example shows a checkbox in the first column, requires the style below.
<tree flex="1">
<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, the following needs to be added to the stylesheet (see treecol.type).
treechildren::-moz-tree-checkbox(checked){
/* css for checked cells */
list-style-image: url("chrome://global/skin/checkbox/cbox-check.gif");
}
[bearbeiten] Attribute
|
Geerbt von XUL-Element |
XUL:Attribute:crop XUL:Attribute:cycler XUL:Attribute:dragging XUL:Attribute:treecol.editable XUL:Attribute:fixed XUL:Attribute:hideheader XUL:Attribute:ignoreincolumnpicker
- label
- Typ: string
- Die Beschriftung für das Element. Wird das Attribut nicht angegeben, so erscheint auch kein Beschriftungstext.
XUL:Attribute:primary XUL:Attribute:sort XUL:Attribute:sortActive XUL:Attribute:sortDirection
- treecol.src
- Typ: Bild-URL
- Um für das treecol-Element ein Bild für den Kopf statt eines labels zu benutzen, kann dieses Attribut gesetzt werden. Im Kopf können nicht gleichzeitig Bild und Beschriftung angezeigt werden. Der URL eines Bildes, das als Spaltenkopf des Baums angezeigt wird, kann mit diesem Attribut festgelegt werden. Wird das Attribut nicht angegeben, erscheint kein Bild und es wird stattdessen die Beschriftung angezeigt. Damit das Bild erscheint, muss die Klasse treecol-image für das treecol-Element gesetzt werden. Ein label sollte dennoch für die Benutzung im Spaltenwähler angegeben werden, falls ignoreincolumnpicker nicht wahr ist und hidecolumnpicker nicht wahr ist für den tree.
XUL:Attribute:treecol.type XUL:Attribute:treecol.width
[bearbeiten] Eigenschaften
|
Geerbt von XUL-Element Geerbt von DOM-Element |
[bearbeiten] Methoden
[bearbeiten] Stilklassen
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
- Um ein Bild als Kopf der Baumspalte anzuzeigen, wird diese Klasse benutzt. Das Bild selbst wird über das Attribut src angegeben.
[bearbeiten] Verwandte Themen
- Elemente
- tree, treecols, treechildren, treeitem, treerow, treecell and treeseparator.
- Schnittstellen
- nsIAccessibleProvider