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 |
---|---|---|
|
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 |
---|---|---|---|
string |
null |
RQL statement that will be added to every request for a list of resources. |
|
string |
undefined |
The name of the property in the data property that contains the list of child objects. |
|
string |
id |
If the store has a single primary key, this indicates the property to use as the identity property. |
|
array |
null |
Data preload for Store. |
|
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 |
---|---|---|
object
|
Retrieves an object by its identity |
|
any
|
Returns an object’s identity |
|
row
object
|
Method for preparing data before completing request |
|
dojo/_base/deferred
|
Stores an object |
|
instance
|
||
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
|
The object to store. |
Method for preparing data before completing request
Return: row object
ARGUMENT |
TYPE |
DESCRIPTION |
---|---|---|
|
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 |
---|---|---|
|
undefined
|
|
|
__HeaderOptions
|
HTTP headers. |
Deletes an object by its identity. This will trigger a DELETE request to the server.
Return: dojo/_base/deferred