Name
baselist — contains a group of baselistitems
Description
This class is a container for a group of
baselistitem
s. To use
baselist
, baselistitem
must be subclassed to provide a visual representation of the list
item. It supports single select by default. Set
multiselect
to true to allow multiple selection
(shift-click for a range, control-click for an arbitrary set).
Contained list items may be declared inside the list, such as:
or replicated from data:
Optimizing Lists
If your lists represent data from a datapath, there are two
optimizations that you may want to consider:
- pooling
- If you will be changing the data that is represented by the list
after it has been created, you can set
dataoption="pooling"
. For more about pooling see the
datapath pooling attribute
and the example in list
.
- lazy
- If there are more items in the list than will be visible and all
list items are the same size (for example, in a scrolling list or
combobox), you should set dataoption="lazy". For more about lazy
replication see the datapath
replication attribute,
LzLazyReplicationManager
, and the example in
list
.
An abstract class which all list components should subclass.
Details
Properties (5)
-
dataoption
-
<attribute name="dataoption" type="string" value="none" />
public var dataoption : String;
One of "lazy", "resize", "pooling", "none".
-
defaultselection
-
<attribute name="defaultselection" value="null" />
public var defaultselection;
The index of the default selected item, if none is provided via
the selected="true" attribute on an item.
-
itemclassname
-
<attribute name="itemclassname" type="string" value="" />
public var itemclassname : String;
The name of the class for new items that will be created with
addItem().
-
multiselect
-
<attribute name="multiselect" value="false" />
If multiselect is true, multiple items may be selected. When the
shift key is down, a range of items is selected. When the control
key is down, any item may be added to the selection.
-
toggleselected
-
<attribute name="toggleselected" value="false" />
public var toggleselected;
When true, the first click on a list item selects it and the
second click deselects it.
Methods (17)
-
addItem()
-
<method name="addItem" args="text, value" />
public function addItem(text : String, value : Object);
Add an item to the end of the list. This method is not available
with dataoption="lazy" or dataoption="resize"
(use the data APIs instead).
-
clearSelection()
-
<method name="clearSelection" />
public function clearSelection();
Clear the current selection.
-
getItem()
-
<method name="getItem" args="value" />
public function getItem(value : Object) : Object;
Find a particular item by value. This method is not available with
dataoption="lazy" or dataoption="resize"
(use the data APIs instead).
-
getItemAt()
-
<method name="getItemAt" args="index" />
public function getItemAt(index : Number) : Object;
Get a particular item by its index. This method is not available
with dataoption="lazy" or dataoption="resize"
(use the data APIs instead).
-
getNumItems()
-
<method name="getNumItems" />
public function getNumItems() : Number;
Get the number of items in the list.
-
getSelection()
-
<method name="getSelection" />
public function getSelection() : Object;
Get the selection for the list. Normally this method returns
views, but if dataoption="lazy" or dataoption="resize",
it will return datapointers.
-
getText()
-
<method name="getText" />
public function getText() : Object;
-
getValue()
-
<method name="getValue" />
public function getValue() : Object;
Get the value(s) for the list.
-
moveSelection()
-
<method name="moveSelection" args="dir" />
public function moveSelection(dir : Number);
Move the selection to the next or previous view. This method not
available with dataoption="lazy" or dataoption="resize"
-
removeItem()
-
<method name="removeItem" args="value" />
public function removeItem(value : Object);
Find the first item with the specified value and remove it from
the list. This method is not available with dataoption="lazy"
or dataoption="resize"
(use the data APIs instead).
-
removeItemAt()
-
<method name="removeItemAt" args="index" />
public function removeItemAt(index : Number);
Find the item at the specified index and remove it from the list.
This method is not available with dataoption="lazy"
or dataoption="resize"
(use data APIs instead).
-
select()
-
<method name="select" args="item" />
public function select(item : LzView);
-
selectItem()
-
<method name="selectItem" args="value" />
public function selectItem(value : Object);
Select an item by value. This method is not available with
dataoption="lazy" or dataoption="resize".
-
selectItemAt()
-
<method name="selectItemAt" args="index" />
public function selectItemAt(index : Number);
-
selectNext()
-
<method name="selectNext" />
public function selectNext();
Move the selection to the next view. This method not available
with dataoption="lazy" or dataoption="resize".
-
selectPrev()
-
<method name="selectPrev" />
public function selectPrev();
Move the selection to the previous view. This method not
available with dataoption="lazy" or dataoption="resize".
-
setHilite()
-
<method name="setHilite" args="v" />
public function setHilite(v : LzView);
Set which view has the hilite.
Events (1)
-
onselect
-
<attribute name="onselect" />
This event is triggered whenever the user makes a selection it may
used as a script in the tag or as an event method.
LZX Synopsis
<class name="
baselist" extends="
baseformitem
">
<attribute name="
dataoption
" type="
string" value="
none" />
<method name="
addItem
" args="
text,
value" />
<method name="
getItem
" args="
value" />
<method name="
select
" args="
item" />
</class>
JavaScript Synopsis
public
baselist extends
baseformitem
{
prototype public function
addItem
(
text : String,
value : Object);
prototype public function
getItem
(
value : Object) :
Object;
prototype public function
getItemAt
(
index : Number) :
Object;
prototype public function
getText
() :
Object;
prototype public function
getValue
() :
Object;
prototype public function
removeItem
(
value : Object);
prototype public function
select
(
item : LzView);
prototype public function
selectItem
(
value : Object);
prototype public function
setHilite
(
v : LzView);
}