data
Type:
Array<any>
jQuery
JavaScript
var store = new DevExpress.data.LocalStore({ data: [ { id: 1, name: "John Doe" }, // ... ] });
Angular
TypeScript
import LocalStore from "devextreme/data/local_store"; // ... export class AppComponent { store: LocalStore; constructor() { this.store = new LocalStore({ data: [ { id: 1, name: "John Doe" }, // ... ] }) } }
errorHandler
Type:
This function accepts a JavaScript Error object as the parameter.
jQuery
JavaScript
var store = new DevExpress.data.LocalStore({ // ... errorHandler: function (error) { console.log(error.message); } });
Angular
TypeScript
import LocalStore from "devextreme/data/local_store"; // ... export class AppComponent { store: LocalStore; constructor() { this.store = new 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.
Type:
Default Value: 10000
jQuery
JavaScript
var store = new DevExpress.data.LocalStore({ // ... immediate: false, flushInterval: 3000 });
Angular
TypeScript
import LocalStore from "devextreme/data/local_store"; // ... export class AppComponent { store: LocalStore; constructor() { this.store = new LocalStore({ // ... immediate: false, flushInterval: 3000 }) } }
key
In the following example, the ProductID
and ProductCode
properties are specified as key properties:
jQuery
JavaScript
var store = new DevExpress.data.LocalStore({ // ... key: ["ProductID", "ProductCode"] });
Angular
TypeScript
import LocalStore from "devextreme/data/local_store"; // ... export class AppComponent { store: LocalStore; constructor() { this.store = new 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.
Type:
onInserted
Type:
jQuery
JavaScript
var store = new DevExpress.data.LocalStore({ onInserted: function (values, key) { // Your code goes here } });
Angular
TypeScript
import LocalStore from "devextreme/data/local_store"; // ... export class AppComponent { store: LocalStore; constructor() { this.store = new LocalStore({ onInserted: function (values, key) { // Your code goes here } }) } }
onInserting
jQuery
JavaScript
var store = new DevExpress.data.LocalStore({ onInserting: function (values) { // Your code goes here } });
Angular
TypeScript
import LocalStore from "devextreme/data/local_store"; // ... export class AppComponent { store: LocalStore; constructor() { this.store = new LocalStore({ onInserting: function (values) { // Your code goes here } }) } }
onLoaded
jQuery
JavaScript
var store = new DevExpress.data.LocalStore({ onLoaded: function (result) { // Your code goes here } });
Angular
TypeScript
import LocalStore from "devextreme/data/local_store"; // ... export class AppComponent { store: LocalStore; constructor() { this.store = new LocalStore({ onLoaded: function (result) { // Your code goes here } }) } }
onLoading
Type:
Function parameters:
loadOptions:
jQuery
JavaScript
var store = new DevExpress.data.LocalStore({ onLoading: function (loadOptions) { // Your code goes here } });
Angular
TypeScript
import LocalStore from "devextreme/data/local_store"; // ... export class AppComponent { store: LocalStore; constructor() { this.store = new LocalStore({ onLoading: function (loadOptions) { // Your code goes here } }) } }
onModified
Type:
jQuery
JavaScript
var store = new DevExpress.data.LocalStore({ onModified: function () { // Your code goes here } });
Angular
TypeScript
import LocalStore from "devextreme/data/local_store"; // ... export class AppComponent { store: LocalStore; constructor() { this.store = new LocalStore({ onModified: function () { // Your code goes here } }) } }
onModifying
Type:
jQuery
JavaScript
var store = new DevExpress.data.LocalStore({ onModifying: function () { // Your code goes here } });
Angular
TypeScript
import LocalStore from "devextreme/data/local_store"; // ... export class AppComponent { store: LocalStore; constructor() { this.store = new LocalStore({ onModifying: function () { // Your code goes here } }) } }
onRemoved
jQuery
JavaScript
var store = new DevExpress.data.LocalStore({ onRemoved: function (key) { // Your code goes here } });
Angular
TypeScript
import LocalStore from "devextreme/data/local_store"; // ... export class AppComponent { store: LocalStore; constructor() { this.store = new LocalStore({ onRemoved: function (key) { // Your code goes here } }) } }
onRemoving
Type:
jQuery
JavaScript
var store = new DevExpress.data.LocalStore({ onRemoving: function (key) { // Your code goes here } });
Angular
TypeScript
import LocalStore from "devextreme/data/local_store"; // ... export class AppComponent { store: LocalStore; constructor() { this.store = new LocalStore({ onRemoving: function (key) { // Your code goes here } }) } }
onUpdated
Type:
jQuery
JavaScript
var store = new DevExpress.data.LocalStore({ onUpdated: function (key, values) { // Your code goes here } });
Angular
TypeScript
import LocalStore from "devextreme/data/local_store"; // ... export class AppComponent { store: LocalStore; constructor() { this.store = new LocalStore({ onUpdated: function (key, values) { // Your code goes here } }) } }
onUpdating
Type:
jQuery
JavaScript
var store = new DevExpress.data.LocalStore({ onUpdating: function (key, values) { // Your code goes here } });
Angular
TypeScript
import LocalStore from "devextreme/data/local_store"; // ... export class AppComponent { store: LocalStore; constructor() { this.store = new LocalStore({ onUpdating: function (key, values) { // Your code goes here } }) } }
Feel free to share demo-related thoughts here.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
Thank you!
We appreciate your feedback.
We appreciate your feedback.