Description
This is a declared replicator for visual elements. Unlike
OpenLaszlo''s data-replication feature, a replicator can take an
arbitrary node set that may be passed in as an array.
Non-replicating elements may be used inside a replicator; only
the last child inside the replicator is replicated.
The data attribute of the replicated (cloned) view is set by the
setData method with data from the nodes array when the clone is
bound.
Details
Properties (10)
-
axis
-
<attribute name="axis" type="string" value="y" />
public var axis : String;
The axis in which to replicate
-
clones
-
<attribute name="clones" />
The list of elements controlled by this repliator
-
container
-
<attribute name="container" />
The view that will contain the replicated nodes. Defaults to the immediateparent of the replicator.
-
dataset
-
<attribute name="dataset" />
Compute nodes from this dataset
-
mask
-
<attribute name="mask" />
The view that will clip the replicated nodes. Defaults to the immediateparent of the container
-
nodes
-
<attribute name="nodes" value="null" />
The list of nodes over which this replictor acts
-
pool
-
<attribute name="pool" type="boolean" value="true" />
public var pool : boolean;
If true, then instances of the replicated instance are reused
when possible
-
replicatedsize
-
<attribute name="replicatedsize" value="null" />
public var replicatedsize;
The size (width or height) in the replication axis of the view
being replicated. Assumes all subviews have same replicated size.
-
spacing
-
<attribute name="spacing" value="0" />
A pixel amount to use between each replicated view
-
xpath
-
<attribute name="xpath" type="string" />
public var xpath : String;
Compute nodes from this xpath query against the specified dataset
Methods (7)
-
bind()
-
<method name="bind" args="v, n" />
public function bind(v : LzView, n : Number);
Called internally, but may be overriden. This is the method
which binds a given clone to an element in the nodes array.
-
ensureInView()
-
<method name="ensureInView" args="n" />
public function ensureInView(n : Number);
Ensures that the clone at the given offset is visible under
the mask
-
getCloneForOffset()
-
<method name="getCloneForOffset" args="n" />
public function getCloneForOffset(n : Number);
Gets the clone for the given offset, scrolling it into view first
if necessary.
-
insertNode()
-
<method name="insertNode" args="idx, n" />
public function insertNode(idx : Number, n : Object);
Insert a node in existing list of elements.
-
setData()
-
<method name="setData" args="v, n" />
public function setData(v : LzView, n);
Called internally, but may be overriden. This is the method is
called to set the data of a clone to an element in the nodes
array.
-
setNodes()
-
<method name="setNodes" args="n" />
public function setNodes(n : Array);
Replicate over the given list of elements
-
unbind()
-
<method name="unbind" args="v" />
public function unbind(v);
Called internally, but may be overriden. This method is called
when a given clone is about to be pooled or destroyed
Events (1)
-
onnodes
-
<attribute name="onnodes" />
LZX Synopsis
<class name="
lz.replicator" extends="
LzView
">
<attribute name="
axis
" type="
string" value="
y" />
<attribute name="
mask
" />
<attribute name="
nodes
" value="
null" />
<attribute name="
pool
" type="
boolean" value="
true" />
<attribute name="
spacing
" value="
0" />
<attribute name="
xpath
" type="
string" />
<method name="
bind
" args="
v,
n" />
<method name="
setData
" args="
v,
n" />
<method name="
unbind
" args="
v" />
</class>
JavaScript Synopsis
public
lz.replicator extends
LzView
{
public var
axis
:
String;
public var
pool
:
boolean;
public var
xpath
:
String;
prototype public function
bind
(
v : LzView,
n : Number);
prototype public function
insertNode
(
idx : Number,
n : Object);
prototype public function
setData
(
v : LzView,
n);
prototype public function
setNodes
(
n : Array);
prototype public function
unbind
(
v);
}