DevExtreme React - ArrayStore Props
This section describes properties that configure the ArrayStore.
data
Specifies the store's associated array.
Array<any>
- // ...
- 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
Specifies the function that is executed when the store throws an error.
This function accepts a JavaScript Error object as the parameter.
- // ...
- import ArrayStore from 'devextreme/data/array_store';
- const store = new ArrayStore({
- // ...
- errorHandler: (error) => {
- console.log(error.message);
- }
- });
- class App extends React.Component {
- // ...
- }
- export default App;
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:
- // ...
- import ArrayStore from 'devextreme/data/array_store';
- const store = new ArrayStore({
- // ...
- key: ['ProductID', 'ProductCode']
- });
- class App extends React.Component {
- // ...
- }
- export default App;
onInserted
A function that is executed after a data item is added to the store.
- // ...
- import ArrayStore from 'devextreme/data/array_store';
- const store = new ArrayStore({
- // ...
- onInserted: function (values, key) {
- // Your code goes here
- }
- });
- class App extends React.Component {
- // ...
- }
- export default App;
onInserting
A function that is executed before a data item is added to the store.
- // ...
- import ArrayStore from 'devextreme/data/array_store';
- const store = new ArrayStore({
- // ...
- onInserting: function (values, key) {
- // Your code goes here
- }
- });
- class App extends React.Component {
- // ...
- }
- export default App;
onLoaded
A function that is executed after data is loaded to the store.
- // ...
- import ArrayStore from 'devextreme/data/array_store';
- const store = new ArrayStore({
- // ...
- onLoaded: function (result) {
- // Your code goes here
- }
- });
- class App extends React.Component {
- // ...
- }
- export default App;
onLoading
A function that is executed before data is loaded to the store.
Data processing settings.
- // ...
- import ArrayStore from 'devextreme/data/array_store';
- const store = new ArrayStore({
- // ...
- onLoading: function (loadOptions) {
- // Your code goes here
- }
- });
- class App extends React.Component {
- // ...
- }
- export default App;
onModified
A function that is executed after a data item is added, updated, or removed from the store.
- // ...
- import ArrayStore from 'devextreme/data/array_store';
- const store = new ArrayStore({
- // ...
- onModified: function () {
- // Your code goes here
- }
- });
- class App extends React.Component {
- // ...
- }
- export default App;
onModifying
A function that is executed before a data item is added, updated, or removed from the store.
- // ...
- import ArrayStore from 'devextreme/data/array_store';
- const store = new ArrayStore({
- // ...
- onModifying: function () {
- // Your code goes here
- }
- });
- class App extends React.Component {
- // ...
- }
- export default App;
onPush
The function executed before changes are pushed to the store.
Array<any>
Changes passed in the push(changes) method.
- // ...
- import ArrayStore from 'devextreme/data/array_store';
- const store = new ArrayStore({
- // ...
- onPush: (changes) => {
- // Your code goes here
- }
- });
- class App extends React.Component {
- // ...
- }
- export default App;
onRemoved
A function that is executed after a data item is removed from the store.
- // ...
- import ArrayStore from 'devextreme/data/array_store';
- const store = new ArrayStore({
- // ...
- onRemoved: function (key) {
- // Your code goes here
- }
- });
- class App extends React.Component {
- // ...
- }
- export default App;
onRemoving
A function that is executed before a data item is removed from the store.
- // ...
- import ArrayStore from 'devextreme/data/array_store';
- const store = new ArrayStore({
- // ...
- onRemoving: function (key) {
- // Your code goes here
- }
- });
- class App extends React.Component {
- // ...
- }
- export default App;
onUpdated
A function that is executed after a data item is updated in the store.
- // ...
- import ArrayStore from 'devextreme/data/array_store';
- const store = new ArrayStore({
- // ...
- onUpdated: function (key, values) {
- // Your code goes here
- }
- });
- class App extends React.Component {
- // ...
- }
- export default App;
onUpdating
A function that is executed before a data item is updated in the store.
- // ...
- import ArrayStore from 'devextreme/data/array_store';
- const store = new ArrayStore({
- // ...
- onUpdating: function (key, values) {
- // Your code goes here
- }
- });
- class App extends React.Component {
- // ...
- }
- export default App;