|
|
|
add(
object
: Object
directives
: dojo.store.api.Store.PutDirectives
) :
void
Creates an object, throws an error if the object already exists
Parameter |
Type |
Usage |
Description |
object |
Object |
required |
The object to store. |
directives |
dojo.store.api.Store.PutDirectives |
optional |
Additional directives for creating objects. |
|
|
|
|
get(
id
: Number
) :
void
Retrieves an object by its identity
Parameter |
Type |
Usage |
Description |
id |
Number |
required |
The identity to use to lookup the object |
|
|
|
|
getChildren(
parent
: Object
options
: dojo.store.api.Store.QueryOptions
) :
void
Retrieves the children of an object.
Parameter |
Type |
Usage |
Description |
parent |
Object |
required |
The object to find the children of. |
options |
dojo.store.api.Store.QueryOptions |
optional |
Additional options to apply to the retrieval of the children. |
|
|
|
|
getIdentity(
object
: Object
) :
void
Returns an object's identity
Parameter |
Type |
Usage |
Description |
object |
Object |
required |
The object to get the identity from |
|
|
|
|
getMetadata(
object
: Object
) :
void
|
|
|
|
put(
object
: Object
directives
: dojo.store.api.Store.PutDirectives
) :
void
Stores an object
Parameter |
Type |
Usage |
Description |
object |
Object |
required |
The object to store. |
directives |
dojo.store.api.Store.PutDirectives |
optional |
Additional directives for storing objects. |
|
|
|
|
PutDirectives(
id
: String|Number
before
: Object
parent
: Object,
overwrite
: Boolean
) :
void
Directives passed to put() and add() handlers for guiding the update and
creation of stored objects.
Parameter |
Type |
Usage |
Description |
id |
String|Number |
optional |
Indicates the identity of the object if a new object is created |
before |
Object |
optional |
If the collection of objects in the store has a natural ordering,
this indicates that the created or updated object should be placed before the
object specified by the value of this property. A value of null indicates that the
object should be last. |
parent |
Object, |
optional |
If the store is hierarchical (with single parenting) this property indicates the
new parent of the created or updated object. |
overwrite |
Boolean |
optional |
If this is provided as a boolean it indicates that the object should or should not
overwrite an existing object. A value of true indicates that a new object
should not be created, the operation should update an existing object. A
value of false indicates that an existing object should not be updated, a new
object should be created (which is the same as an add() operation). When
this property is not provided, either an update or creation is acceptable. |
|
|
|
|
query(
query
: String|Object|Function
options
: dojo.store.api.Store.QueryOptions
) :
void
Queries the store for objects. This does not alter the store, but returns a
set of data from the store.
Parameter |
Type |
Usage |
Description |
query |
String|Object|Function |
required |
The query to use for retrieving objects from the store. |
options |
dojo.store.api.Store.QueryOptions |
required |
The optional arguments to apply to the resultset. |
Examples
|
|
|
|
queryEngine(
) :
void
If the store can be queried locally (on the client side in JS), this defines
the query engine to use for querying the data store.
This takes a query and query options and returns a function that can execute
the provided query on a JavaScript array. The queryEngine may be replace to
|
|
|
|
QueryOptions(
sort
: dojo.store.api.Store.SortInformation[]
start
: Number
count
: Number
) :
void
Optional object with additional parameters for query results.
Parameter |
Type |
Usage |
Description |
sort |
dojo.store.api.Store.SortInformation[] |
optional |
A list of attributes to sort on, as well as direction |
start |
Number |
optional |
The first result to begin iteration on |
count |
Number |
optional |
The number of how many results should be returned. |
|
|
|
|
remove(
id
: Number
) :
void
Deletes an object by its identity
Parameter |
Type |
Usage |
Description |
id |
Number |
required |
The identity to use to delete the object |
|
|
|
|
SortInformation(
attribute
: String
descending
: Boolean
) :
void
|
|
|
|
transaction(
) :
void
Starts a new transaction.
Note that a store user might not call transaction() prior to using put,
delete, etc. in which case these operations effectively could be thought of
as "auto-commit" style actions.
|