DataManager is used to manage and manipulate relational data.
Processes the middleware stack after receiving the response.
Parameter | Type | Description |
---|---|---|
response | string | Object |
The response object. |
Returns Promise
Processes the middleware stack before sending the request.
Parameter | Type | Description |
---|---|---|
request | Object |
The request object. |
Returns Promise
Executes the given query with local data source.
Parameter | Type | Description |
---|---|---|
query (optional) | Query |
Defines the query to retrieve data. |
Returns Object[]
Executes the given query with either local or remote data source. It will be executed as asynchronously and returns Promise object which will be resolved or rejected after action completed.
Parameter | Type | Description |
---|---|---|
query | Query | Function |
Defines the query to retrieve data. |
done (optional) | Function |
Defines the callback function and triggers when the Promise is resolved. |
fail (optional) | Function |
Defines the callback function and triggers when the Promise is rejected. |
always (optional) | Function |
Defines the callback function and triggers when the Promise is resolved or rejected. |
Returns Promise
Get the queries maintained in the persisted state.
Parameter | Type | Description |
---|---|---|
id (optional) | string |
The identifier of the persisted query to retrieve. |
Returns object
Inserts new record in the given table.
Parameter | Type | Description |
---|---|---|
data | Object |
Defines the data to insert. |
tableName (optional) | string | Query |
Defines the table name. |
query (optional) | Query |
Sets default query for the DataManager. |
position (optional) | number |
Returns Object | Promise
Removes data from the table with the given key.
Parameter | Type | Description |
---|---|---|
keyField | string |
Defines the column field. |
value | Object |
Defines the value to find the data in the specified column. |
tableName (optional) | string | Query |
Defines the table name |
query (optional) | Query |
Sets default query for the DataManager. |
Returns Object | Promise
Save bulk changes to the given table name. User can add a new record, edit an existing record, and delete a record at the same time. If the datasource from remote, then updated in a single post.
Parameter | Type | Description |
---|---|---|
changes | Object |
Defines the CrudOptions. |
key (optional) | string |
Defines the column field. |
tableName (optional) | string | Query |
Defines the table name. |
query (optional) | Query |
Sets default query for the DataManager. |
original (optional) | Object |
Returns Promise | Object
Overrides DataManager’s default query with given query.
Parameter | Type | Description |
---|---|---|
query | Query |
Defines the new default query. |
Returns DataManager
Set the queries to be maintained in the persisted state.
Parameter | Type | Description |
---|---|---|
e | Event |
The event parameter that triggers the setPersistData method. |
id (optional) | string |
The identifier of the persisted query to set. |
persistData (optional) | object |
The data to be persisted. |
Returns void
Updates existing record in the given table.
Parameter | Type | Description |
---|---|---|
keyField | string |
Defines the column field. |
value | Object |
Defines the value to find the data in the specified column. |
tableName (optional) | string | Query |
Defines the table name |
query (optional) | Query |
Sets default query for the DataManager. |
original (optional) | Object |
Returns Object | Promise
Registers a new middleware in the DataManager.
Returns Promise