Visit Mozilla.org

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
align, allowevents, allownegativeassertions, class, coalesceduplicatearcs, collapsed, container, containment, context, contextmenu, datasources, dir, empty, equalsize, flags, flex, height, hidden, id, insertafter, insertbefore, left, maxheight, maxwidth, menu, minheight, minwidth, mousethrough, observes, ordinal, orient, pack, persist, popup, position, preference-editable, querytype, ref, removeelement, sortDirection, sortResource, sortResource2, statustext, style, template, tooltip, tooltiptext, top, uri, wait-cursor, width

XUL:Attribute:crop XUL:Attribute:cycler XUL:Attribute:dragging XUL:Attribute:treecol.editable XUL:Attribute:fixed XUL:Attribute:hidden 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

XUL:Property:accessibleType

Geerbt von XUL-Element
align, allowEvents, boxObject, builder, className, collapsed, contextMenu, controllers, currentItem, database, datasources, dir, flex, height, hidden, id, left, listBoxObject, maxHeight, maxWidth, menu, minHeight, minWidth, observes, ordinal, orient, pack, persist, ref, resource, statusText, style, tooltip, tooltipText, top, value, width

Geerbt von DOM-Element
attributes, childNodes, cloneNode, firstChild, lastChild, localName, namespaceURI, nextSibling, nodeName, nodeType, nodeValue, ownerDocument, parentNode, prefix, previousSibling, tagName

[bearbeiten] Methoden

Geerbt von XUL-Element
blur, click, doCommand, focus, getElementsByAttribute

Geerbt von DOM-Element
addEventListener, appendChild, dispatchEvent, getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, hasAttribute, hasAttributeNS, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeAttribute, removeAttributeNode, removeAttributeNS, removeChild, removeEventListener, replaceChild, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS

[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