Generic store used to work with HTTP endpoints supporting REST. The endpoint should support Resource Query Language for filtering and must return the ``Content-Range`` HTTP header for paging the printed content.
Table of contents
var vpsStore = new Store({
apsType: "http://aps-standard.org/samples/basic/vps/1.0",
target: "/aps/2/resources/"
});
ARGUMENT | TYPE | DESCRIPTION |
---|---|---|
options |
dojo.store.JsonRest
|
This provides any configuration information that will be mixed into the store apsType: the type of apsResource |
var vpsStore = new Store({
apsType: "http://aps-standard.org/samples/basic/vps/1.0",
target: "/aps/2/resources/"
});
PROPERTY | TYPE | DEFAULT | DESCRIPTION |
---|---|---|---|
baseQuery | string | null | RQL statement that will be added to every request for a list of resources. |
childrenProperty | string | undefined | The name of the property in the data property that contains the list of child objects. |
idProperty | string | id | If the store has a single primary key, this indicates the property to use as the identity property. |
initialData | array | null | Data preload for Store. |
target | string | “” | The target base URL to use for all requests to the server. |
RQL statement that will be added to every request for a list of resources. Default value: null.
The name of the property in the data property that contains the list of child objects. Default value: undefined.
If the store has a single primary key, this indicates the property to use as the identity property. The values of this property should be unique. Default value: “id”.
Data preload for Store. Default value: null.
The target base URL to use for all requests to the server. This string will be prepended to the id to generate the URL (relative or absolute) for requests sent to the server. Default value: “”.
METHOD | RETURN | DESCRIPTION |
---|---|---|
get () | object
|
Retrieves an object by its identity |
getIdentity (object) | any
|
Returns an object’s identity |
mapQuery (row) | row
object
|
Method for preparing data before completing request |
put () | dojo/_base/deferred
|
Stores an object |
query (query, options) | instance
|
|
remove () | dojo/_base/deferred
|
Deletes an object by its identity |
Retrieves an object by its identity. This will trigger a GET request to the server using the url this.target + id.
Return: object
Returns an object’s identity.
Return: any
ARGUMENT | TYPE | DESCRIPTION |
---|---|---|
object |
Object
|
The object to store. |
Method for preparing data before completing request
Return: row object
ARGUMENT | TYPE | DESCRIPTION |
---|---|---|
row |
Object
|
Received from server row which must be processed |
Stores an object. This will trigger a PUT request to the server if the object has an id, otherwise it will trigger a POST request.
Return: dojo/_base/deferred
Return: instance
ARGUMENT | TYPE | DESCRIPTION |
---|---|---|
query |
undefined
|
|
options |
__HeaderOptions
|
HTTP headers. |
Deletes an object by its identity. This will trigger a DELETE request to the server.
Return: dojo/_base/deferred