| id | DataSource.Options.store |
|---|---|
| type | Store | Store_Options | Array<any> |
Configures the store underlying the DataSource.
This property accepts one of the following:
-
Store instance
An ArrayStore, LocalStore, ODataStore, or CustomStore instance. -
Store configuration object
An ArrayStore, LocalStore, or ODataStore configuration object. Make sure to set the type property. -
Array
Assigning an array to the store property automatically creates an ArrayStore in the DataSource.
<!--JavaScript-->
var ds = new DevExpress.data.DataSource({
store: new DevExpress.data.ArrayStore({
// ArrayStore instance
})
// ===== or =====
store: {
type: "array",
// ArrayStore configuration object
}
// ===== or =====
store: [
{ id: 1, name: "John Doe" }
]
});
<!--TypeScript-->
import DataSource from "devextreme/data/data_source";
import ArrayStore from "devextreme/data/array_store";
// ...
export class AppComponent {
ds: DataSource;
constructor() {
this.ds = new DataSource({
store: new ArrayStore({
// ArrayStore instance
})
// ===== or =====
store: {
type: "array",
// ArrayStore configuration object
}
// ===== or =====
store: [
{ id: 1, name: "John Doe" }
]
});
}
}
<!-- tab: App.vue -->
<script>
import DataSource from 'devextreme/data/data_source';
import ArrayStore from 'devextreme/data/array_store';
const ds = new DataSource({
store: new ArrayStore({
// ArrayStore instance
})
// ===== or =====
store: {
type: 'array',
// ArrayStore configuration object
}
// ===== or =====
store: [
{ id: 1, name: 'John Doe' }
]
});
export default {
// ...
data() {
return {
ds
}
}
}
</script>
<!-- tab: App.js -->
// ...
import DataSource from 'devextreme/data/data_source';
import ArrayStore from 'devextreme/data/array_store';
const ds = new DataSource({
store: new ArrayStore({
// ArrayStore instance
})
// ===== or =====
store: {
type: 'array',
// ArrayStore configuration object
}
// ===== or =====
store: [
{ id: 1, name: 'John Doe' }
]
});
class App extends React.Component {
// ...
}
export default App;