The goog.ds.JsDataSource Class

goog.ds.JsDataSource
> goog.ds.DataNode

goog.ds.JsDataSource(root, dataName, opt_parent)

Data source whose backing is JavaScript data Names that are reserved for system use and shouldn't be used for data node names: eval, toSource, toString, unwatch, valueOf, watch. Behavior is undefined if these names are used.

root {Object}
The root JS node.
dataName {string}
The name of this node relative to the parent node.
opt_parent {Object=}
Optional parent of this JsDataSource. implements goog.ds.DataNode.

.get(var_args)

Get the value of the node

var_args {...?}
Do not check arity of arguments, because some subclasses require args.
returns {*}
The value of the node, or null if no value.

.getChildNode(name, opt_canCreate)

Gets a named child node of the current node

name {string}
The node name.
opt_canCreate {boolean=}
If true, can create child node.
returns {goog.ds.DataNode}
The child node, or null if no node of this name exists.

.getChildNodeValue(name)

Gets the value of a child node

name {string}
The node name.
returns {Object}
The value of the node, or null if no value or the child node doesn't exist.

.getChildNodes(opt_selector)

TODO(user) revisit lazy creation.

opt_selector {string=}
String selector to choose child nodes.
returns {goog.ds.DataNodeList}
The child nodes.

.getDataName()

Get the name of the node relative to the parent node

returns {string}
The name of the node.

.getDataPath()

Gets the a qualified data path to this node

returns {string}
The data path.

.getLoadState()

Gets the state of the backing data for this node TODO(user) Discuss null value handling

returns {goog.ds.LoadState}
The state.

.isList()

Whether the value of this node is a homogeneous list of data

returns {boolean}
True if a list.

.load()

Load or reload the backing data for this node

.set(value)

Set the value of the node

value {*}
The new value of the node.

.setChildNode(name, value)

Sets a named child node of the current node. If value is null, removes the child node.

name {string}
The node name.
value {Object}
The value to set, can be DataNode, object, property, or null.
returns {Object}
The child node, if set.

.setDataName(dataName)

Setthe name of the node relative to the parent node

dataName {string}
The name of the node.