DevExtreme Angular - LocalStore Properties
data
Array<any>
jQuery
var store = new DevExpress.data.LocalStore({ data: [ { id: 1, name: "John Doe" }, // ... ] });
Angular
import LocalStore from "devextreme/data/local_store"; // ... export class AppComponent { store: LocalStore; constructor() { this.store = new LocalStore({ data: [ { id: 1, name: "John Doe" }, // ... ] }) } }
Vue
<script> import ArrayStore from 'devextreme/data/array_store'; const store = new ArrayStore({ data: [ { id: 1, name: 'John Doe' }, // ... ] }); export default { // ... } </script>
React
// ... import ArrayStore from 'devextreme/data/array_store'; const store = new ArrayStore({ data: [ { id: 1, name: 'John Doe' }, // ... ] }); class App extends React.Component { // ... } export default App;
errorHandler
This function accepts a JavaScript Error object as the parameter.
jQuery
var store = new DevExpress.data.LocalStore({ // ... errorHandler: function (error) { console.log(error.message); } });
Angular
import LocalStore from "devextreme/data/local_store"; // ... export class AppComponent { store: LocalStore; constructor() { this.store = new LocalStore({ // ... errorHandler: function (error) { console.log(error.message); } }) } }
Vue
<script> import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... errorHandler: (error) => { console.log(error.message); } }); export default { // ... } </script>
React
// ... import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... errorHandler: (error) => { console.log(error.message); } }); class App extends React.Component { // ... } export default App;
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.
jQuery
var store = new DevExpress.data.LocalStore({ // ... immediate: false, flushInterval: 3000 });
Angular
import LocalStore from "devextreme/data/local_store"; // ... export class AppComponent { store: LocalStore; constructor() { this.store = new LocalStore({ // ... immediate: false, flushInterval: 3000 }) } }
Vue
<script> import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... immediate: false, flushInterval: 3000 }); export default { // ... } </script>
React
// ... import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... immediate: false, flushInterval: 3000 }); class App extends React.Component { // ... } export default App;
key
In the following example, the ProductID
and ProductCode
properties are specified as key properties:
jQuery
var store = new DevExpress.data.LocalStore({ // ... key: ["ProductID", "ProductCode"] });
Angular
import LocalStore from "devextreme/data/local_store"; // ... export class AppComponent { store: LocalStore; constructor() { this.store = new LocalStore({ // ... key: ["ProductID", "ProductCode"] }) } }
Vue
<script> import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... key: ['ProductID', 'ProductCode'] }); export default { // ... } </script>
React
// ... import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... key: ['ProductID', 'ProductCode'] }); class App extends React.Component { // ... } export default App;
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.
jQuery
var store = new DevExpress.data.LocalStore({ // ... name: "myStore" });
Angular
import LocalStore from "devextreme/data/local_store"; // ... export class AppComponent { store: LocalStore; constructor() { this.store = new LocalStore({ // ... name: "myStore" }) } }
Vue
<script> import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... name: 'myStore' }); export default { // ... } </script>
React
// ... import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... name: 'myStore' }); class App extends React.Component { // ... } export default App;
onInserted
jQuery
var store = new DevExpress.data.LocalStore({ onInserted: function (values, key) { // Your code goes here } });
Angular
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 } }) } }
Vue
<script> import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... onInserted: function (values, key) { // Your code goes here } }); export default { // ... } </script>
React
// ... import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... onInserted: function (values, key) { // Your code goes here } }); class App extends React.Component { // ... } export default App;
onInserting
jQuery
var store = new DevExpress.data.LocalStore({ onInserting: function (values) { // Your code goes here } });
Angular
import LocalStore from "devextreme/data/local_store"; // ... export class AppComponent { store: LocalStore; constructor() { this.store = new LocalStore({ onInserting: function (values) { // Your code goes here } }) } }
Vue
<script> import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... onInserting: function (values, key) { // Your code goes here } }); export default { // ... } </script>
React
// ... import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... onInserting: function (values, key) { // Your code goes here } }); class App extends React.Component { // ... } export default App;
onLoaded
jQuery
var store = new DevExpress.data.LocalStore({ onLoaded: function (result) { // Your code goes here } });
Angular
import LocalStore from "devextreme/data/local_store"; // ... export class AppComponent { store: LocalStore; constructor() { this.store = new LocalStore({ onLoaded: function (result) { // Your code goes here } }) } }
Vue
<script> import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... onLoaded: function (result) { // Your code goes here } }); export default { // ... } </script>
React
// ... import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... onLoaded: function (result) { // Your code goes here } }); class App extends React.Component { // ... } export default App;
onLoading
jQuery
var store = new DevExpress.data.LocalStore({ onLoading: function (loadOptions) { // Your code goes here } });
Angular
import LocalStore from "devextreme/data/local_store"; // ... export class AppComponent { store: LocalStore; constructor() { this.store = new LocalStore({ onLoading: function (loadOptions) { // Your code goes here } }) } }
Vue
<script> import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... onLoading: function (loadOptions) { // Your code goes here } }); export default { // ... } </script>
React
// ... import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... onLoading: function (loadOptions) { // Your code goes here } }); class App extends React.Component { // ... } export default App;
onModified
jQuery
var store = new DevExpress.data.LocalStore({ onModified: function () { // Your code goes here } });
Angular
import LocalStore from "devextreme/data/local_store"; // ... export class AppComponent { store: LocalStore; constructor() { this.store = new LocalStore({ onModified: function () { // Your code goes here } }) } }
Vue
<script> import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... onModified: function () { // Your code goes here } }); export default { // ... } </script>
React
// ... import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... onModified: function () { // Your code goes here } }); class App extends React.Component { // ... } export default App;
onModifying
jQuery
var store = new DevExpress.data.LocalStore({ onModifying: function () { // Your code goes here } });
Angular
import LocalStore from "devextreme/data/local_store"; // ... export class AppComponent { store: LocalStore; constructor() { this.store = new LocalStore({ onModifying: function () { // Your code goes here } }) } }
Vue
<script> import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... onModifying: function () { // Your code goes here } }); export default { // ... } </script>
React
// ... import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... onModifying: function () { // Your code goes here } }); class App extends React.Component { // ... } export default App;
onPush
Array<any>
Changes passed in the push(changes) method.
jQuery
var store = new DevExpress.data.LocalStore({ onPush: function(changes) { // Your code goes here } });
Angular
import LocalStore from "devextreme/data/local_store"; // ... export class AppComponent { store: LocalStore; constructor() { this.store = new LocalStore({ onPush: (changes) => { // Your code goes here } }) } }
Vue
<script> import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... onPush: (changes) => { // Your code goes here } }); export default { // ... } </script>
React
// ... import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... onPush: (changes) => { // Your code goes here } }); class App extends React.Component { // ... } export default App;
onRemoved
jQuery
var store = new DevExpress.data.LocalStore({ onRemoved: function (key) { // Your code goes here } });
Angular
import LocalStore from "devextreme/data/local_store"; // ... export class AppComponent { store: LocalStore; constructor() { this.store = new LocalStore({ onRemoved: function (key) { // Your code goes here } }) } }
Vue
<script> import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... onRemoved: function (key) { // Your code goes here } }); export default { // ... } </script>
React
// ... import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... onRemoved: function (key) { // Your code goes here } }); class App extends React.Component { // ... } export default App;
onRemoving
jQuery
var store = new DevExpress.data.LocalStore({ onRemoving: function (key) { // Your code goes here } });
Angular
import LocalStore from "devextreme/data/local_store"; // ... export class AppComponent { store: LocalStore; constructor() { this.store = new LocalStore({ onRemoving: function (key) { // Your code goes here } }) } }
Vue
<script> import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... onRemoving: function (key) { // Your code goes here } }); export default { // ... } </script>
React
// ... import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... onRemoving: function (key) { // Your code goes here } }); class App extends React.Component { // ... } export default App;
onUpdated
jQuery
var store = new DevExpress.data.LocalStore({ onUpdated: function (key, values) { // Your code goes here } });
Angular
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 } }) } }
Vue
<script> import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... onUpdated: function (key, values) { // Your code goes here } }); export default { // ... } </script>
React
// ... import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... onUpdated: function (key, values) { // Your code goes here } }); class App extends React.Component { // ... } export default App;
onUpdating
jQuery
var store = new DevExpress.data.LocalStore({ onUpdating: function (key, values) { // Your code goes here } });
Angular
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 } }) } }
Vue
<script> import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... onUpdating: function (key, values) { // Your code goes here } }); export default { // ... } </script>
React
// ... import LocalStore from 'devextreme/data/local_store'; const store = new LocalStore({ // ... onUpdating: function (key, values) { // Your code goes here } }); class App extends React.Component { // ... } export default App;
If you have technical questions, please create a support ticket in the DevExpress Support Center.