Listcell

A single cell of a listbox, used for cells which contain text only.

More information about listcell

Style Classes:

listcell-iconic

Properties and Methods:

disabled

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
ref
removeelement
sortDirection
sortResource
sortResource2
statustext
style
template
tooltip
tooltiptext
top
uri
wait-cursor
width

crop

Type: one of the values below

If the label of the listcell is too small to fit in its given space, the text will be cropped on the side specified by the crop attribute. An ellipsis will be used in place of the cropped text. If the box direction is reversed, the cropping is reversed.

disabled

Type: boolean

Indicates whether the listcell is disabled or not. If this attribute is set to true, the listcell is disabled. This is usually drawn with the text in grey. If the listcell is disabled, it does not respond to user actions. The element cannot be focused and the command event will not fire. The element will still respond to mouse events. To enable the listcell, leave the attribute out entirely as opposed to setting the value to false.

image

Type: image URL

The URL of the image to appear on the listcell. If this is attribute is left out, no image appears. The position of the image is determined by the dir and orient attributes. You must use the class 'listcell-iconic' to have an image appear.

label

Type: string

The label that will appear on the listcell. If this is left out, no text appears.

type

Type: string

You can make a cell in a listbox a checkbox by setting this attribute to the value 'checkbox'.


Style Classes:

The following classes may be used to style the element. These classes should be used instead of changing the style of the element directly since they will fit more naturally with the user's selected theme.

listcell-iconic

Use this class to have an image appear on the listcell. Specify the image using the image attribute.


Properties and Methods:

disabled

Type: boolean

Indicates whether the listcell is disabled or not. If this attribute is set to true, the listcell is disabled. This is usually drawn with the text in grey. If the listcell is disabled, it does not respond to user actions. The element cannot be focused and the command event will not fire. The element will still respond to mouse events. To enable the listcell, leave the attribute out entirely as opposed to setting the value to false.

Inherited from XUL Element:

align allowEvents blur boxObject boxObject.element
boxObject.getLookAndFeelMetric boxObject.height boxObject.screenX boxObject.screenY boxObject.width
boxObject.x boxObject.y builder className click
collapsed contextMenu controllers database datasources
dir doCommand flex focus getElementsByAttribute
height hidden id left maxHeight
maxWidth menu minHeight minWidth observes
ordinal orient pack persist ref
resource statusText style tooltip tooltipText
top width

Inherited from Element:

addEventListener
appendChild
attributes
childNodes
cloneNode
dispatchEvent
firstChild
getAttribute
getAttributeNS
getAttributeNode
getAttributeNodeNS
getElementsByTagName
getElementsByTagNameNS
hasAttribute
hasAttributeNS
hasAttributes
hasChildNodes
insertBefore
isSupported
lastChild
localName
namespaceURI
nextSibling
nodeName
nodeType
nodeValue
normalize
ownerDocument
parentNode
prefix
previousSibling
removeAttribute
removeAttributeNS
removeAttributeNode
removeChild
removeEventListener
replaceChild
setAttribute
setAttributeNS
setAttributeNode
setAttributeNodeNS
tagName
Add a note User Contributed Notes
June 3, 2005, 7:22 am nate dot snapp at comcast
After a lot of searching for how to put <checkbox> inside <listcell> tags and have it be clickable, I found the answer on the newsgroup mozilla.public.dev.xul. Make sure to add the attribute allowevents="true" to the <listitem> parent.
May 6, 2005, 2:55 pm pike-xul at kw dot nl
The <listcell type="checkbox"> is not an interactive widget. it serves as default content for a <listitem type="checkbox" />, which contains the interaction code. You can use it to display a checkbox, but you won't be able to check/uncheck it.
April 30, 2005, 5:51 pm pike-xul at kw dot nl
If you use a
<listitem type="checkbox"
the listitem gets an additional boolean property and attribute
listitem.checked
... see chrome://global/content/bindings/listbox.xml#listitem-checkbox

Copyright © 1999 - 2005 XULPlanet.com