<list>
contains listitems and provides selection capabilities.

JavaScript: lz.list

The <list> tag creates a list which may contain <listitem>s. Subclasses of listitem, such as textlistitem, may be used as well. <list> provides basic layout and a selection API . If there are more items than specified in the shownitems attribute, a scrollbar will be provided.

<canvas height="100">
              <list x="10" y="10">
              <textlistitem text="item 1" value="1" selected="true"/>
              <textlistitem text="item 2" value="2"/>
              <textlistitem text="item 3" value="3"/>
              </list>
              </canvas>

Optimizing performance with lazy replication and data pooling

When you have more items on your list than appear to the user, or if you are creating a list from data and then changing the data that is represented by the list, you should use "lazy replication" and data pooling, respectively, to optimize performance of your lists. See Performance Tuning for a discussion.

See the list_example.lzx for more list use cases.

A list containing listitems and providing selection capabilities.

Attributes

Name (CSS property) Type (tag) Type (js) Default Category
autoscrollbar expression any true read/write
  If true, a scrollbar will show up automatically when there are more items than shownitems.
border_bottom expression any this.bordersize read/write
  The size of the bottom border.
border_left expression any this.bordersize read/write
  The size of the left border.
border_right expression any this.bordersize read/write
  The size of the right border.
bordersize expression any 1 read/write
  The size in pixels for this list.
border_top expression any this.bordersize read/write
  The size of the top border.
minheight number Number 24 read/write
  minumum height of the list
scrollable expression any false readonly
   
scrollbarclassname string String vscrollbar read/write
  The name of the class to instantiate as our scrollbar.
shownitems expression any -1 read/write
  The number of items that are displayed. This value will ignored if this view attempts to draw past the canvas boundary.
spacing expression any 0 read/write
  The number of pixels that items should be spaced from one another.
tracking expression any false read/write
  Toggles the mousedown tracking.

Attributes inherited from <basevaluecomponent>

type, value

Methods

addItem()
list.addItem(txt : String, val : Object);
Add the specified item to the end of the list.
Parameter Name Type Description
txt String the text for the item.
val Object the value for the item.

ensureItemInView()
list.ensureItemInView(item);
If the item is not in view, the list is auto-scrolled so that the specified item appears at the top of the list.
Parameter Name Type Description
item    

select()
list.select(v : lz.view);
Select an item. Scrolls list so that it appears, if not in view.
Parameter Name Type Description
v lz.view the view to select (may be an array, when multiselect == true)

Methods inherited from lz.Eventable

destroy, setAttribute

Events

Events inherited from <baselist>

onitemclassname, onselect

Events inherited from <baseformitem>

onchanged, onvalue

Events inherited from <node>

onconstruct, ondata, oninit

Events inherited from lz.Eventable

ondestroy