DevExtreme jQuery - LocalStore Options
This section describes properties that configure the LocalStore.
data
Specifies the store's associated array.
Array<any>
- var store = new DevExpress.data.LocalStore({
- data: [
- { id: 1, name: "John Doe" },
- // ...
- ]
- });
errorHandler
Specifies the function that is executed when the store throws an error.
This function accepts a JavaScript Error object as the parameter.
- var store = new DevExpress.data.LocalStore({
- // ...
- errorHandler: function (error) {
- console.log(error.message);
- }
- });
flushInterval
Specifies a delay in milliseconds between when data changes and the moment these changes are saved in the local storage. Applies only if immediate is false.
- var store = new DevExpress.data.LocalStore({
- // ...
- immediate: false,
- flushInterval: 3000
- });
immediate
Specifies whether the LocalStore saves changes in the local storage immediately.
See Also
key
Specifies the key property (or properties) that provide(s) key values to access data items. Each key value must be unique.
In the following example, the ProductID and ProductCode properties are specified as key properties:
- var store = new DevExpress.data.LocalStore({
- // ...
- key: ["ProductID", "ProductCode"]
- });
name
Specifies the name under which data should be saved in the local storage. The dx-data-localStore- prefix will be added to the name.
- var store = new DevExpress.data.LocalStore({
- // ...
- name: "myStore"
- });
onInserted
A function that is executed after a data item is added to the store.
- var store = new DevExpress.data.LocalStore({
- onInserted: function (values, key) {
- // Your code goes here
- }
- });
onInserting
A function that is executed before a data item is added to the store.
- var store = new DevExpress.data.LocalStore({
- onInserting: function (values) {
- // Your code goes here
- }
- });
onLoaded
A function that is executed after data is loaded to the store.
- var store = new DevExpress.data.LocalStore({
- onLoaded: function (result) {
- // Your code goes here
- }
- });
onLoading
A function that is executed before data is loaded to the store.
Data processing settings.
- var store = new DevExpress.data.LocalStore({
- onLoading: function (loadOptions) {
- // Your code goes here
- }
- });
onModified
A function that is executed after a data item is added, updated, or removed from the store.
- var store = new DevExpress.data.LocalStore({
- onModified: function () {
- // Your code goes here
- }
- });
onModifying
A function that is executed before a data item is added, updated, or removed from the store.
- var store = new DevExpress.data.LocalStore({
- onModifying: function () {
- // Your code goes here
- }
- });
onPush
The function executed before changes are pushed to the store.
Array<any>
Changes passed in the push(changes) method.
- var store = new DevExpress.data.LocalStore({
- onPush: function(changes) {
- // Your code goes here
- }
- });
onRemoved
A function that is executed after a data item is removed from the store.
- var store = new DevExpress.data.LocalStore({
- onRemoved: function (key) {
- // Your code goes here
- }
- });
onRemoving
A function that is executed before a data item is removed from the store.
- var store = new DevExpress.data.LocalStore({
- onRemoving: function (key) {
- // Your code goes here
- }
- });
onUpdated
A function that is executed after a data item is updated in the store.
- var store = new DevExpress.data.LocalStore({
- onUpdated: function (key, values) {
- // Your code goes here
- }
- });