lz.DataNode is the base class for the classes
that represent OpenLaszlo's hierarchical data format.
<canvas width="300" height="300">
<simplelayout axis="y"/>
<text width="300" height="250" bgcolor="silver" multiline="true" name="display"/>
<button>Make some data
<attribute name="currentstep" value="0"/>
<handler name="onclick"><![CDATA[
switch(currentstep ++){
case 0:
this.n = new LzDataElement('numbers');
setAttribute('text', 'Add some children');
break;
case 1:
for (var i = 1; i < 11 ; i++){
this.n.appendChild(new LzDataElement('number' ,
{value : i}));
}
setAttribute('text', 'Add linebreaks');
break;
case 2:
var dp = new LzDatapointer();
dp.setPointer(this.n.getFirstChild());
do {
dp.p.parentNode.insertBefore(new LzDataText('\n'),
dp.p);
} while (dp.selectNext())
dp.p.parentNode.appendChild(new LzDataText('\n'));
setAttribute('visible', false);
break;
}
display.setText(display.escapeText(n.serialize()));
]]></handler>
</button>
</canvas>
| Name | Type (tag) | Type (js) | Default | Category |
|---|---|---|---|---|
childNodes
|
lz.DataNodeMixin | read/write | ||
| An array of children of this node | ||||
nodeType
|
int | read/write | ||
| The type of this node -- ELEMENT_NODE or TEXT_NODE | ||||
ownerDocument
|
read/write | |||
parentNode
|
read/write | |||
Methods
| childOf() |
|---|
| Parameter Name | Type | Description |
|---|---|---|
| el | lz.DataElement | The LzDataElement to test to see if it is above this one |
| allowself | Boolean | If true, this function returns true if the given node is the same as this node. |
| cloneNode() |
|---|
| Parameter Name | Type | Description |
|---|---|---|
| deep | Boolean | If true, the children of this node will be part of the new node |
| getNextSibling() |
|---|
| getOffset() |
|---|
| getParent() |
|---|
| getPreviousSibling() |
|---|
| serialize() |
|---|
| setOwnerDocument() |
|---|
![]() |
This method is deprecated |
|---|---|
| Use setAttribute('ownerDocument', ...) instead. |
| Parameter Name | Type | Description |
|---|---|---|
| ownerDoc | lz.DataNodeMixin | The LzDataNodeMixin to act as the ownerDocument for this node. |
Copyright © 2002-2008 Laszlo Systems, Inc. All Rights Reserved. Unauthorized use, duplication or distribution is strictly prohibited. This is the proprietary information of Laszlo Systems, Inc. Use is subject to license terms.