Visit Mozilla.org

XUL:grid

From MDC

« XUL Reference home    [ Examples | Attributes | Properties | Methods | Related ]

A grid is an element that contains both rows and columns elements. It is used to create a grid of elements. Both the rows and columns are displayed at once although only one will typically contain content, while the other may provide size information. Whichever is last in the grid is displayed on top.

More information is available in the XUL tutorial.

[edit] Example

Image:XUL_ref_grid.png
<!-- groupbox containing a grid. 
     The second column is twice as big as the first column -->
<groupbox>
  <caption label="Details"/>
  <grid>
    <columns>
      <column flex="1"/>
      <column flex="2"/>
    </columns>
    <rows>
      <row>
        <label value="User name"/>
        <textbox id="user"/>
      </row>
      <row>
        <label value="Group"/>
        <menulist>
          <menupopup>
            <menuitem label="Accounts"/>
            <menuitem label="Sales" selected="true"/>
            <menuitem label="Support"/>
          </menupopup>
        </menulist>
      </row>
    </rows>
  </grid>
</groupbox>

[edit] Attributes

Inherited from 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

[edit] Properties

Inherited from 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

Inherited from DOM element
attributes, childNodes, cloneNode, firstChild, lastChild, localName, namespaceURI, nextSibling, nodeName, nodeType, nodeValue, ownerDocument, parentNode, prefix, previousSibling, tagName

[edit] Methods

Inherited from XUL element
blur, click, doCommand, focus, getElementsByAttribute

Inherited from 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

[edit] Related

Elements
columns, column, rows, row.