Functiondojo.data.api.Read.getValues

dojo.require("dojo.data.api.Read");
defined in dojo/data/api/Read.js

This getValues() method works just like the getValue() method, but getValues() always returns an array rather than a single attribute value. The array may be empty, may contain a single attribute value, or may contain many attribute values. If the item does not have a value for the given attribute, then getValues() will return an empty array: []. (So, if store.hasAttribute(item, attribute) has a return of false, then store.getValues(item, attribute) will return [].)

Usage

function (item, attribute) (view source)
parametertypedescription
item The item to access values on.
attribute The attribute to access represented as a string.

Examples

Example 1

var friendsOfLuke = store.getValues(lukeSkywalker, "friends");