The goog.ds.JsonDataSource Class

goog.ds.JsonDataSource
> goog.ds.JsDataSource
> goog.ds.DataNode

goog.ds.JsonDataSource(uri, name, opt_callbackParamName)

Data source whose backing is a JSON-like service, in which retreiving the resource specified by URL with the additional parameter callback. The resource retreived is executable JavaScript that makes a call to the named function with a JavaScript object literal as the only parameter. Example URI could be: http://www.google.com/data/search?q=monkey&callback=mycb which might return the JS: mycb({searchresults: [{uri: 'http://www.monkey.com', title: 'Site About Monkeys'}]}); TODO(user): Evaluate using goog.net.Jsonp here. A URI of an empty string will mean that no request is made and the data source will be a data source with no child nodes

uri {string|goog.Uri}
URI for the request.
name {string}
Name of the datasource.
opt_callbackParamName {string=}
The parameter name that is used to specify the callback. Defaults to 'callback'.

.get(var_args)

Inherited from goog.ds.JsDataSource .

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)

Inherited from goog.ds.JsDataSource .

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)

Inherited from goog.ds.JsDataSource .

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)

Inherited from goog.ds.JsDataSource .

TODO(user) revisit lazy creation.

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

.getDataName()

Inherited from goog.ds.JsDataSource .

Get the name of the node relative to the parent node

returns {string}
The name of the node.

.getDataPath()

Inherited from goog.ds.JsDataSource .

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

returns {goog.ds.LoadState}
The state.

.isList()

Inherited from goog.ds.JsDataSource .

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. Fires the JsonDataSource

.receiveData(obj)

Receives data from a Json request

obj {Object}
The JSON data.

.set(value)

Inherited from goog.ds.JsDataSource .

Set the value of the node

value {*}
The new value of the node.

.setChildNode(name, value)

Inherited from goog.ds.JsDataSource .

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)

Inherited from goog.ds.JsDataSource .

Setthe name of the node relative to the parent node

dataName {string}
The name of the node.