Login Register Help
API Documentation
Choose a stylesheet:

Constructordojo.data.api.Write

dojo.require("dojo.data.api.Write");
defined in dojo/data/api/Write.js
This is an abstract API that data provider implementations conform to. This file defines function signatures and intentionally leaves all the functionss unimplemented.

FunctionsBack to top

Defined by dojo.data.api.Read
The close() method is intended for instructing the store to 'close' out any information associated with a particular request.
FunctioncontainsValue(item: item, attribute: attribute-name-string, value: anything): Boolean
Defined by dojo.data.api.Read
Returns true if the given *value* is one of the values that getValues() would return.
FunctiondeleteItem(item: item): Boolean
Overrides
Deletes an item from the store.
Functionfetch(keywordArgs: Object): an object conforming to the dojo.data.api.Request API
Defined by dojo.data.api.Read
Given a query and set of defined options, such as a start and count of items to return, this method executes the query and makes the results available as data items. The format and expectations of stores is that they operate in a generally asynchronous manner, therefore callbacks are always used to return items located by the fetch parameters.
FunctiongetAttributes(item: item): Array
Defined by dojo.data.api.Read
Returns an array with all the attributes that this item has. This method will always return an array; if the item has no attributes at all, getAttributes() will return an empty array: [].
Overrides dojo.data.api.Read,
See dojo.data.api.Read.getFeatures()
FunctiongetLabel(item: item)
Defined by dojo.data.api.Read
Method to inspect the item and return a user-readable 'label' for the item that provides a general/adequate description of what the item is.
FunctiongetLabelAttributes(item: item)
Defined by dojo.data.api.Read
Method to inspect the item and return an array of what attributes of the item were used to generate its label, if any.
FunctiongetValue(item: item, attribute: attribute-name-string, defaultValue: value?): a literal, an item, null, or undefined (never an array)
Defined by dojo.data.api.Read
Returns a single attribute value. Returns defaultValue if and only if *item* does not have a value for *attribute*. Returns null if and only if null was explicitly set as the attribute value. Returns undefined if and only if the item does not have a value for the given attribute (which is the same as saying the item does not have the attribute).
FunctiongetValues(item: item, attribute: attribute-name-string): an array that may contain literals and items
Defined by dojo.data.api.Read
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 [].)
FunctionhasAttribute(item: item, attribute: attribute-name-string): Boolean
Defined by dojo.data.api.Read
Returns true if the given *item* has a value for the given *attribute*.
FunctionisDirty(item: item?): Boolean
Overrides
Given an item, isDirty() returns true if the item has been modified since the last save(). If isDirty() is called with no *item* argument, then this function returns true if any item has been modified since the last save().
FunctionisItem(something: anything): Boolean
Defined by dojo.data.api.Read
Returns true if *something* is an item and came from the store instance. Returns false if *something* is a literal, an item from another store instance, or is any object other than an item.
FunctionisItemLoaded(something: anything): Boolean
Defined by dojo.data.api.Read
Returns false if isItem(something) is false. Returns false if if isItem(something) is true but the the item is not yet loaded in local memory (for example, if the item has not yet been read from the server).
FunctionloadItem(keywordArgs: Object)
Defined by dojo.data.api.Read
Given an item, this method loads the item so that a subsequent call to store.isItemLoaded(item) will return true. If a call to isItemLoaded() returns true before loadItem() is even called, then loadItem() need not do any work at all and will not even invoke the callback handlers. So, before invoking this method, check that the item has not already been loaded.
FunctionnewItem(keywordArgs: Object?, parentInfo: Object?): item
Overrides
Returns a newly created item. Sets the attributes of the new item based on the *keywordArgs* provided. In general, the attribute names in the keywords become the attributes in the new item and as for the attribute values in keywordArgs, they become the values of the attributes in the new item. In addition, for stores that support hierarchical item creation, an optional second parameter is accepted that defines what item is the parent of the new item and what attribute of that item should the new item be assigned to. In general, this will assume that the attribute targetted is multi-valued and a new item is appended onto the list of values for that attribute.
Overrides
Discards any unsaved changes.
Functionsave(keywordArgs: Object)
Overrides
Saves to the server all the changes that have been made locally. The save operation may take some time and is generally performed in an asynchronous fashion. The outcome of the save action is is passed into the set of supported callbacks for the save.
FunctionsetValue(item: item, attribute: String, value: almost): Boolean
Overrides
Sets the value of an attribute on an item. Replaces any previous value or values.
FunctionsetValues(item: item, attribute: String, values: Array): Boolean
Overrides
Adds each value in the *values* array as a value of the given attribute on the given item. Replaces any previous value or values. Calling store.setValues(x, y, []) (with *values* as an empty array) has the same effect as calling store.unsetAttribute(x, y).
FunctionunsetAttribute(item: item, attribute: String): Boolean
Overrides
Deletes all the values of an attribute on an item.