lz.DataElementMixin
A node of hierarchical data.

JavaScript: lz.DataElementMixin

Attributes

Name (CSS property) Type (tag) Type (js) Default Category
attributes   Object   read/write
  The dictionary of attributes for this node.
nodeName   String   read/write
  The name of this node.

Methods

appendChild()
lz.DataElementMixin.appendChild(newChild : lz.DataNodeMixin);
Adds a child to this node's list of childNodes
Parameter Name Type Description
newChild lz.DataNodeMixin The LzDataNodeMixin to add.
Returns Type Description
  lz.DataNodeMixin The newChild.

getAttr()
lz.DataElementMixin.getAttr(name : String);
Returns the value for the give attribute
Parameter Name Type Description
name String The name of the attribute whose value to return
Returns Type Description
  String The value for the given attribute

getElementsByTagName()
lz.DataElementMixin.getElementsByTagName(name : String);
Returns a list of the childNodes of this node which have a given name
Parameter Name Type Description
name String The name of the node to look for.
Returns Type Description
  [lz.DataNodeMixin] A list of childNodes which have the given name.

getFirstChild()
lz.DataElementMixin.getFirstChild();
Returns the first child of this node.
Returns Type Description
  lz.DataNodeMixin The first child of this node

getLastChild()
lz.DataElementMixin.getLastChild();
Returns the last child of this node.
Returns Type Description
  lz.DataNodeMixin The last child of this node

handleDocumentChange()
lz.DataElementMixin.handleDocumentChange(what : String, who : lz.DataNodeMixin, type : Number, cobj);
Nodes call this method on their ownerDocument whenever they change in any way. This method sends the onDocumentChange event, which triggers datapointer updates
Parameter Name Type Description
what String A description of what changed.
who lz.DataNodeMixin The node that changed.
type Number private
cobj    

hasAttr()
lz.DataElementMixin.hasAttr(name : String);
Tests whether or not this node has a given attribute.
Parameter Name Type Description
name String The name of the attribute to test
Returns Type Description
  Boolean If true, the named attribute is present.

hasChildNodes()
lz.DataElementMixin.hasChildNodes();
Tests whether or not this node has child nodes.
Returns Type Description
  Boolean If true, this node has child nodes.

insertBefore()
lz.DataElementMixin.insertBefore(newChild : lz.DataNodeMixin, refChild : lz.DataNodeMixin);
Inserts the given LzDataNodeMixin before another node in this node's childNodes
Parameter Name Type Description
newChild lz.DataNodeMixin the LzDataNodeMixin to insert
refChild lz.DataNodeMixin the LzDataNodeMixin to insert newChild before
Returns Type Description
  lz.DataNodeMixin The new child, or null if the refChild wasn't found

removeAttr()
lz.DataElementMixin.removeAttr(name : String);
Removes the named attribute
Parameter Name Type Description
name String The name of the attribute to remove.

removeChild()
lz.DataElementMixin.removeChild(oldChild : lz.DataNodeMixin);
Removes a given node from this node's childNodes
Parameter Name Type Description
oldChild lz.DataNodeMixin The LzDataNodeMixin to remove
Returns Type Description
  lz.DataNodeMixin The removed child, or null if the oldChild was not found

replaceChild()
lz.DataElementMixin.replaceChild(newChild : lz.DataNodeMixin, oldChild : lz.DataNodeMixin);
Replaces a given LzDataNodeMixin in this node's childNodes with a new one.
Parameter Name Type Description
newChild lz.DataNodeMixin the LzDataNodeMixin to add
oldChild lz.DataNodeMixin the LzDataNodeMixin to be replaced by the newChild
Returns Type Description
  lz.DataNodeMixin The new child, or null if the oldChild wasn't found @dev-note: DOM-Spec (Level2, Level3) says we need to return the oldChild instead of the newChild

setAttr()
lz.DataElementMixin.setAttr(name : String, value : String);
Sets the given attribute to the given value
Parameter Name Type Description
name String The name of the attribute to set.
value String The value for the attribute.