AjaxStore
Store that uses the Fetch API to read data from a remote server, and optionally sends synchronization requests to the server containing information about locally created, modified and deleted records.
Create
Posts array of JSON data for newly added records to createUrl, expects response containing an array of JSON objects in same order with id set (uses Model#idField as id).
Read
Reads array of JSON data from the data packet returned from the readUrl. Unique id for each row is required.
By default looks in field 'id' but can be configured by setting idField.
Update
Posts array of JSON data containing modified records to updateUrl. By default, only changed fields and any fields configured with alwaysWrite are sent. If you want all fields to always be sent, please see writeAllFields
Delete
Posts to deleteUrl with removed records ids (for example id=1,4,7).
new AjaxStore({
createUrl : 'php/create',
readUrl : 'php/read',
updateUrl : 'php/update',
deleteUrl : 'php/delete',
modelClass : Customer
});
Lazy loading
true. This will make the store send a fetch request
to the configured readUrl when a range of records is needed, rather than for the complete dataset at
once. Each request will be made up of 1 chunk before and after the requested index (which gives a total of 2 chunks).
The chunk size can be configured in the lazyLoad config.
There is a guide for implementing lazy loading in Grid.
Pagination
Configuring an AjaxStore with pageParamName or pageStartParamName means that the
store requests pages of data from the remote source, sending the configured pageParamName or
pageStartParamName to request the page along with the pageSizeParamName.
If pageParamName is set, that is passed with the requested page number (one based), along with the
pageSizeParamName.
If pageStartParamName is set, that is passed with the requested page starting record index (zero based), along
with the pageSizeParamName.
The JSON response packet for one page should look like this:
{
"success" : true,
"total" : 50000,
"data" : [{
"id" : 1,
"title" : "Row 1"
}, ... for the rest of the pageSize ... ]
}
The success property indicates whether the request
succeeded. If this is false, an exception event is fired.
The store needs to know the total dataset size in order to know how many pages it may ask for.
This is returned in the total property
Remote filtering
To specify that filtering is the responsibility of the server, configure the store with
filterParamName: 'nameOfFilterParameter'
When this is set, any filter operation causes the store to reload itself, encoding the filters as JSON representations in the filterParamName HTTP parameter.
The filters will look like this:
{
"field": "country",
"operator": "=",
"value": "sweden",
"caseSensitive": false
}
If the value of the filter is a date - it is serialized as a local time, using the format: YYYY-MM-DDThh:mm:ss.ms
The encoding may be overridden by configuring an implementation of encodeFilterParams into the store which returns the value for the filterParamName when passed an Iterable of filters.
Remote sorting
To specify that sorting is the responsibility of the server, configure the store with
sortParamName: 'nameOfSortParameter'
When this is set, any sort operation causes the store to reload itself, encoding the sorters as JSON representations in the sortParamName HTTP parameter.
The sorters will look like this:
{
"field": "name",
"ascending": true
}
The encoding may be overridden by configuring an implementation of encodeSorterParams into the store which returns the value for the sortParamName when passed an Iterable of sorters.
Passing HTTP headers
As mentioned above AjaxStore uses the Fetch API under the hood. Specify fetchOptions and/or
headers to have control over the options passed with all fetch calls. For example to pass along an
authorization header:
const store = new AjaxStore({
headers : {
Authorization : 'auth-contents-goes-here'
}
});
Learn more about the Fetch API over at MDN.
Getting local record count
To get the number of "visible" records locally available in the store (records that would be shown when using the Store as the data source for a Grid or similar), use the count property. This will return the number of records in the store after filtering and grouping has been applied, including the generated group headers and footers but excluding any records inside collapsed parents or group headers:
const visibleRecords = store.count;
To get other local counts, such as the total number of data records in the store including those collapsed away and filtered out (when not using remote filtering), use the more flexible getCount method:
// Include records that have been filtered out,
// as well as any records inside collapsed groups or tree nodes.
const records = store.getCount({
collapsed : true,
filteredOut : true
});
// Including group headers + summary records
const records = store.getCount({
headersFooters : true
});
// All records, including group headers and filtered out records
const allRecords = store.getCount({
all : true
});
Configs
80
Configs
80Common
The timeout in milliseconds to wait before persisting changes to the server.
Used when autoCommit is set to true.
True to initiate a load when the store is instantiated
CRUD
Url to post newly created records to.
The response must be in the form:
{
"success": true,
"data": [{
"id": 0, "name": "General Motors"
}, {
"id": 1, "name": "Apple"
}]
}
Just the array of data may be returned, however that precludes the orderly handling of errors encountered at the server.
If the server encountered an error, the packet would look like this:
{
"success": false,
"message": "Some kind of database error"
}
And that packet would be available in the exception handler in the response property of the
event.
The success property may be omitted, it defaults to true.
Url for deleting records.
The response must be in the form:
{
"success": true
}
If the server encountered an error, the packet would look like this:
{
"success": false,
"message": "Some kind of database error"
}
And that packet would be available in the exception handler in the response property of the
event.
The success property may be omitted, it defaults to true.
Url to read data from.
The response must be in the form:
{
"success": true,
"data": [{
"id": 0, "name": "General Motors"
}, {
"id": 1, "name": "Apple"
}]
}
If the store is paged, the total dataset size must be returned in the responseTotalProperty property:
{
"success": true,
"data": [{
"id": 0, "name": "General Motors"
}, {
"id": 1, "name": "Apple"
}],
"total": 65535
}
Just the array of data may be returned, however that precludes the orderly handling of errors encountered at the server.
If the server encountered an error, the packet would look like this:
{
"success": false,
"message": "Some kind of database error"
}
And that packet would be available in the exception handler in the response property of the
event.
The success property may be omitted, it defaults to true.
Url to post record modifications to.
The response must be in the form:
{
"success": true,
"data": [{
"id": 0, "name": "General Motors"
}, {
"id": 1, "name": "Apple"
}]
}
Just the array of data may be returned, however that precludes the orderly handling of errors encountered at the server.
If the server encountered an error, the packet would look like this:
{
"success": false,
"message": "Some kind of database error"
}
And that packet would be available in the exception handler in the response property of the
event.
The success property may be omitted, it defaults to true.
Other
This config is taken into account only when store is part of a scheduling project.
If such store loads data via readUrl, automatic calculation of the schedule after the load might lead to some data modifications (for example if syncDataOnLoad is enabled). Such modifications will then be submitted back to the server, which might not be needed, since the data is already coming from the server.
Enabling this config will ignore data modifications during the propagation stage and nothing will be submitted to server.
If set to true, or a config object, this makes the store load new records when needed. When a record that
is not already loaded is requested, a request to the configured readUrl
will be made.
| Parameter | Type | Description |
|---|---|---|
lazyLoad | Object | Lazy load config |
lazyLoad.chunkSize | Number | The number of records to be loaded before and after the requested index. |
Pass a function to transform record creation data before it is sent to the backend
new AjaxStore({
transformCreationData : payload => {
// Transform the data and return the payload
for (const creationData of payload.data) {
creationData.timestamp = Date.now();
}
return payload;
}
});
| Parameter | Type | Description |
|---|---|---|
payload | Object | |
payload.data | Array | The data that is going to be sent to the backend |
Return the modified payload
Pass a function to transform data loaded from the backend before it is turned into records and added to the store
new AjaxStore({
transformLoadedData : response => {
// Transform the loaded data and return the response object
}
});
| Parameter | Type | Description |
|---|---|---|
response | Object | |
response.data | Array | The data that is going to be loaded into the store |
Returns the modified response object
Pass a function to transform records modification data before it is sent to the backend
new AjaxStore({
transformModificationData : payload => {
// Transform the data and return the payload
for (const recordData of payload.data) {
// Some kind of transformation here...
if (recordData.ignore) {
ArrayHelper.remove(payload.data, recordData);
}
}
return payload;
}
});
| Parameter | Type | Description |
|---|---|---|
payload | Object | |
payload.data | Array | The data that is going to be sent to the backend |
Return the modified payload
Pass a function to transform record removal data before it is sent to the backend
new AjaxStore({
transformRemovalData : payload => {
// Transform the data and return the payload
const transformedData = {};
for (const id of payload.ids) {
transformedData[id] = true;
}
payload.ids = transformedData;
return payload;
}
});
| Parameter | Type | Description |
|---|---|---|
payload | Object | |
payload.ids | Array | Ids for records being removed |
Return the modified payload
Remote
An object containing the Fetch options to pass to each server request issued by this store. Use this to control if credentials are sent and other options, read more at MDN.
Example usage:
const store = new AjaxStore({
fetchOptions : {
credentials : 'omit',
redirect : 'error'
}
});
A string keyed object containing the HTTP headers to add to each server request issued by this store.
AjaxStore uses the Fetch API under the hood, read more about headers on
MDN
Example usage:
const store = new AjaxStore({
headers : {
Authorization : 'auth-contents-goes-here'
}
});
The HTTP methods to use for CRUD requests when useRestfulMethods is enabled.
new AjaxStore({
useRestfulMethods : true,
httpMethods : {
create : 'POST',
read : 'POST',
update : 'PATCH',
delete : 'DELETE'
}
});
An object containing key/value pairs that are passed on the request query string, or in the request body if HTTP method allows. See paramsInBody config.
When this config is enabled, the params of "read" request are placed in the request body instead of the query string, if the HTTP method allows.
The name of the HTTP parameter passed to this Store's readUrl to indicate the node id
to load when loading child nodes on demand if the node being expanded was created with data containing
children: true.
The property name in JSON responses from the server that contains the data for the records
{
"success" : true,
// The property name used here should match that of 'responseDataProperty'
"data" : [
...
]
}
The optional property name in JSON responses from the server that contains a boolean success/fail status.
{
"responseMeta" : {
{
"success" : true,
"count" : 100
},
// The property name used here should match that of 'responseDataProperty'
"data" : [
...
]
}
The store would be configured with:
{
...
successDataProperty : 'responseMeta.success',
responseTotalProperty : 'responseMeta.count'
...
}
The property name in JSON responses from the server that contains the dataset total size when this store is paged or lazy loaded
{
"success" : true,
// The property name used here should match that of 'responseDataProperty'
"data" : [
...
],
// The property name used here should match that of 'responseTotalProperty'
"total" : 65535
}
Set this flag to true if you are filtering remote using restful URLs (e.g. https://nominatim.openstreetmap.org/search/paris?format=json)
Note: When this is set, the filter string is appended to the readUrl.
Specify true to send payloads as form data, false to send as regular JSON.
Set to ´true´ to use restful httpMethods
Specify true to send all model fields when committing modified records (as opposed to just the
modified fields)
Tree
Set to false to only include the id of a removed parent node in the request to the backend, and not the ids
of its children. Applies when configured with a deleteUrl.
Consider the following scenario, removing parent 1:
{
id : 1,
children : [
{ id : 11 },
{ id : 12 }
]
}
With includeChildrenInRemoveRequest : false, the backend will only receive the removal of id 1.
With includeChildrenInRemoveRequest : true (the default), the backend will receive the removal of id 1, 11
and 12.
Advanced
Chained store
Filtering
Paging
Records
Properties
68
Properties
68Common
Class hierarchy
CRUD
Url to post newly created records to.
The response must be in the form:
{
"success": true,
"data": [{
"id": 0, "name": "General Motors"
}, {
"id": 1, "name": "Apple"
}]
}
Just the array of data may be returned, however that precludes the orderly handling of errors encountered at the server.
If the server encountered an error, the packet would look like this:
{
"success": false,
"message": "Some kind of database error"
}
And that packet would be available in the exception handler in the response property of the
event.
The success property may be omitted, it defaults to true.
Url for deleting records.
The response must be in the form:
{
"success": true
}
If the server encountered an error, the packet would look like this:
{
"success": false,
"message": "Some kind of database error"
}
And that packet would be available in the exception handler in the response property of the
event.
The success property may be omitted, it defaults to true.
Returns true if the Store is currently committing
Returns a truthy value if the Store is currently loading.
A load operation is initiated by a load call, but the network request is not sent until after a delay until the next event loop because of allowing all operations which may request a load to coalesce into one call.
If the loading request is in this waiting state, the value will be 1,
If the network request is in flight, the value will be 2
Url to read data from.
The response must be in the form:
{
"success": true,
"data": [{
"id": 0, "name": "General Motors"
}, {
"id": 1, "name": "Apple"
}]
}
If the store is paged, the total dataset size must be returned in the responseTotalProperty property:
{
"success": true,
"data": [{
"id": 0, "name": "General Motors"
}, {
"id": 1, "name": "Apple"
}],
"total": 65535
}
Just the array of data may be returned, however that precludes the orderly handling of errors encountered at the server.
If the server encountered an error, the packet would look like this:
{
"success": false,
"message": "Some kind of database error"
}
And that packet would be available in the exception handler in the response property of the
event.
The success property may be omitted, it defaults to true.
Url to post record modifications to.
The response must be in the form:
{
"success": true,
"data": [{
"id": 0, "name": "General Motors"
}, {
"id": 1, "name": "Apple"
}]
}
Just the array of data may be returned, however that precludes the orderly handling of errors encountered at the server.
If the server encountered an error, the packet would look like this:
{
"success": false,
"message": "Some kind of database error"
}
And that packet would be available in the exception handler in the response property of the
event.
The success property may be omitted, it defaults to true.
Other
If set to true, or a config object, this makes the store load new records when needed. When a record that
is not already loaded is requested, a request to the configured readUrl
will be made.
| Parameter | Type | Description |
|---|---|---|
lazyLoad | Object | Lazy load config |
lazyLoad.chunkSize | Number | The number of records to be loaded before and after the requested index. |
Remote
An object containing key/value pairs that are passed on the request query string, or in the request body if HTTP method allows. See paramsInBody config.
Advanced
Filtering
Misc
Records
Functions
101
Functions
101CRUD
Commits all changes (added, modified and removed) using corresponding urls (createUrl, updateUrl and deleteUrl)
A Promise which is resolved only if all pending changes (Create, Update and Delete)
successfully resolve. Both the resolve and reject functions are passed a commitState object which is stored the
afterRequest event for each request. Each event contains the exception, request and response
properties eg:
{
// If *all* commits succeeded
success: true,
changes: {
added: [records...],
modified: [records...],
removed: [records...],
},
added: {
source: theStore,
// Only if the add request triggered an exception
exception: true,
// Only if the add request triggered an exception
exceptionType: 'server', // Or 'network'
response: Response,
json: parsedResponseObject
},
// Same format as added
modified: {},
removed: {}
}
If there were no pending changes, the resolve and reject functions are passed no parameters.
If a commit operation already is in progress, a new one will be queued to execute after. The resolved function is passed the event object passed to any event handlers. The rejected function is passed the exception event if an exception occurred.
Load data from the readUrl. If configured as lazyLoad, this will load 1 chunk of records starting from index 0. If the store has previously been loaded, it will first be cleared of all records and all lazy load cache.
| Parameter | Type | Description |
|---|---|---|
params | Object | A hash of parameters to append to querystring (will also append Store#params) |
A Promise which will be resolved if the load succeeds, and rejected if the load is
vetoed by a beforeLoad handler, or if an exception is detected.
The resolved function is passed the event object passed to any event handlers.
The rejected function is passed the exception event if an exception occurred,
or false if the load was vetoed by a beforeLoad handler.
Loads children into specified parent record. Parent records id is sent as a param (param name configured with parentIdParamName.
| Parameter | Type | Description |
|---|---|---|
parentRecord | Model | Parent record |
A Promise which will be resolved if the load succeeds, and rejected if the load is
vetoed by a beforeLoadChildren handler, or if an exception is detected.
The resolved function is passed the event object passed to any event handlers.
The rejected function is passed the exception event if an exception occurred,
or false if the load was vetoed by a beforeLoadChildren handler.
Loads a page of data from the readUrl.
| Parameter | Type | Description |
|---|---|---|
page | Number | The one based page number to load. |
params | Object | A hash of parameters to append to querystring (will also append Store#params) |
A Promise which will be resolved if the load succeeds, and rejected if the load is
vetoed by a beforeLoadPage handler, or if an exception is detected.
The resolved function is passed the event object passed to any event handlers.
The rejected function is passed the exception event if an exception occurred,
or false if the load was vetoed by a beforeLoadPage handler.
Other
A provided function which creates an array of values for the filterParamName to pass any filters to the server upon load.
By default, this creates a JSON string containing the following properties:
[{
field : <theFieldName>
operator : May be: `'='`, `'!='`, `'>'`, `'>='`, `'<'`, `'<='`, `'*'`, `'startsWith'`, `'endsWith'`
value : The value to compare
caseSensitive : true for case sensitive comparisons
}]
| Parameter | Type | Description |
|---|---|---|
filters | CollectionFilter[] | The filters to encode. |
A provided function which creates an array of values for the {#config-sortParamName} to pass any sorters to the server upon load.
By default, this creates a JSON string containing the following properties:
[{
field : <theFieldName>
ascending : true/false
}]
| Parameter | Type | Description |
|---|---|---|
sorters | Sorter[] | The sorters to encode. |
Configuration
Events
Records
Search
Sort, group & filter
Events
45
Events
45Fired before loading starts. Allows altering parameters and is cancelable by returning false. For paged stores,
instead listen to beforeLoadPage. For remote loading of tree child nodes, listen to
beforeLoadChildren.
// Adding a listener using the "on" method
ajaxStore.on('beforeLoad', ({ source, action, url, params }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
action | String | The read action being performed: |
url | String | The URL to which the HTTP request will be sent. This property may be mutated in an event handler without changing the base readUrl configured for this Store. |
params | Object | An object containing property/name pairs which are the parameters. This may be mutated to affect the parameters used in the Ajax request. |
Fired before loading of remote child nodes of a tree node starts. Allows altering parameters and is cancelable
// Adding a listener using the "on" method
ajaxStore.on('beforeLoadChildren', ({ source, action, url, params }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
action | String | The read action being performed: |
url | String | The URL to which the HTTP request will be sent. This property may be mutated in an event handler without changing the base readUrl configured for this Store. |
params | Object | An object containing property/name pairs which are the parameters. This may be mutated to affect the parameters used in the Ajax request. |
Fired after committing added records
// Adding a listener using the "on" method
ajaxStore.on('commitAdded', ({ source }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
Fired after committing modified records
// Adding a listener using the "on" method
ajaxStore.on('commitModified', ({ source }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
Fired after committing removed records
// Adding a listener using the "on" method
ajaxStore.on('commitRemoved', ({ source }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
Fired when a remote request fails, either at the network level, or the server returns a failure, or an invalid response.
Note that when a commit fails, more than one exception event will be triggered. The individual
operation, create, update or delete will trigger their own exception event, but the encapsulating commit
operation will also trigger an exception event when all the operations have finished, so if exceptions are
going to be handled gracefully, the event's action property must be examined, and the constituent operations of
the event must be examined.
// Adding a listener using the "on" method
ajaxStore.on('exception', ({ source, exception, action, exceptionType, response, json }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
exception | Boolean |
|
action | create | read | update | delete | commit | Action that failed, |
exceptionType | network | failure | The type of failure, |
response | Response | the |
json | Object | The decoded response object if the exceptionType is |
Fired on successful load
// Adding a listener using the "on" method
ajaxStore.on('load', ({ source, data, response, json }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
data | Object[] | Data loaded |
response | Response | the |
json | Object | The decoded response object. |
Fired on successful load of remote child nodes for a tree node.
// Adding a listener using the "on" method
ajaxStore.on('loadChildren', ({ source, data, json }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
data | Object[] | Data loaded |
json | Object | The decoded response object. |
Fired when loading of remote child nodes into a tree node is beginning. This is not cancelable. Parameters in the event may still be mutated at this stage.
// Adding a listener using the "on" method
ajaxStore.on('loadChildrenStart', ({ source, params }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
params | Object | An object containing property/name pairs which are the parameters. This may be mutated to affect the parameters used in the Ajax request. |
When the store is paged, this is fired when a page load is beginning.
// Adding a listener using the "on" method
ajaxStore.on('loadPageStart', ({ source, params }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
params | Object | An object containing property/name pairs which are the parameters. This may be mutated to affect the parameters used in the Ajax request. |
Fired when loading is beginning. This is not cancelable. Parameters in the event may still be mutated at this stage.
// Adding a listener using the "on" method
ajaxStore.on('loadStart', ({ source, params }) => {
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
params | Object | An object containing property/name pairs which are the parameters. This may be mutated to affect the parameters used in the Ajax request. |
Event handlers
45
Event handlers
45Called before loading starts. Allows altering parameters and is cancelable by returning false. For paged stores,
instead listen to beforeLoadPage. For remote loading of tree child nodes, listen to
beforeLoadChildren.
new AjaxStore({
onBeforeLoad({ source, action, url, params }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
action | String | The read action being performed: |
url | String | The URL to which the HTTP request will be sent. This property may be mutated in an event handler without changing the base readUrl configured for this Store. |
params | Object | An object containing property/name pairs which are the parameters. This may be mutated to affect the parameters used in the Ajax request. |
Called before loading of remote child nodes of a tree node starts. Allows altering parameters and is cancelable
new AjaxStore({
onBeforeLoadChildren({ source, action, url, params }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
action | String | The read action being performed: |
url | String | The URL to which the HTTP request will be sent. This property may be mutated in an event handler without changing the base readUrl configured for this Store. |
params | Object | An object containing property/name pairs which are the parameters. This may be mutated to affect the parameters used in the Ajax request. |
Called after committing added records
new AjaxStore({
onCommitAdded({ source }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
Called after committing modified records
new AjaxStore({
onCommitModified({ source }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
Called after committing removed records
new AjaxStore({
onCommitRemoved({ source }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
Called when a remote request fails, either at the network level, or the server returns a failure, or an invalid response.
Note that when a commit fails, more than one exception event will be called. The individual
operation, create, update or delete will trigger their own exception event, but the encapsulating commit
operation will also trigger an exception event when all the operations have finished, so if exceptions are
going to be handled gracefully, the event's action property must be examined, and the constituent operations of
the event must be examined.
new AjaxStore({
onException({ source, exception, action, exceptionType, response, json }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
exception | Boolean |
|
action | create | read | update | delete | commit | Action that failed, |
exceptionType | network | failure | The type of failure, |
response | Response | the |
json | Object | The decoded response object if the exceptionType is |
Called on successful load
new AjaxStore({
onLoad({ source, data, response, json }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
data | Object[] | Data loaded |
response | Response | the |
json | Object | The decoded response object. |
Called on successful load of remote child nodes for a tree node.
new AjaxStore({
onLoadChildren({ source, data, json }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
data | Object[] | Data loaded |
json | Object | The decoded response object. |
Called when loading of remote child nodes into a tree node is beginning. This is not cancelable. Parameters in the event may still be mutated at this stage.
new AjaxStore({
onLoadChildrenStart({ source, params }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
params | Object | An object containing property/name pairs which are the parameters. This may be mutated to affect the parameters used in the Ajax request. |
When the store is paged, this is called when a page load is beginning.
new AjaxStore({
onLoadPageStart({ source, params }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
params | Object | An object containing property/name pairs which are the parameters. This may be mutated to affect the parameters used in the Ajax request. |
Called when loading is beginning. This is not cancelable. Parameters in the event may still be mutated at this stage.
new AjaxStore({
onLoadStart({ source, params }) {
}
});| Parameter | Type | Description |
|---|---|---|
source | Store | This Store |
params | Object | An object containing property/name pairs which are the parameters. This may be mutated to affect the parameters used in the Ajax request. |
Typedefs
9
Typedefs
9Http methods used by the AjaxStore in restful mode.
| Parameter | Type | Description |
|---|---|---|
create | POST | PUT | |
read | GET | POST | |
update | PATCH | POST | PUT | |
delete | DELETE | POST |