The ODataStore is a store that provides an interface for loading and editing data from an individual OData entity collection and handling related events.
jQueryvar store = new DevExpress.data.ODataStore({ url: "http://www.example.com/Northwind.svc/Products", key: "ProductID", keyType: "Int32", // Other ODataStore properties go here }); // ===== or inside the DataSource ===== var dataSource = new DevExpress.data.DataSource({ store: { type: "odata", url: "http://www.example.com/Northwind.svc/Products", key: "ProductID", keyType: "Int32", // Other ODataStore properties go here }, // Other DataSource properties go here });Angular
import ODataStore from "devextreme/data/odata/store"; import DataSource from "devextreme/data/data_source"; // ... export class AppComponent { store: ODataStore; dataSource: DataSource; constructor () { this.store = new ODataStore({ url: "http://www.example.com/Northwind.svc/Products", key: "ProductID", keyType: "Int32", // Other ODataStore properties go here }); // ===== or inside the DataSource ===== this.dataSource = new DataSource({ store: new ODataStore({ url: "http://www.example.com/Northwind.svc/Products", key: "ProductID", keyType: "Int32", // Other ODataStore properties go here }), // Other DataSource properties go here }); } }Vue
<script> import ODataStore from 'devextreme/data/odata/store'; import DataSource from 'devextreme/data/data_source'; const store = new ODataStore({ url: 'http://www.example.com/Northwind.svc/Products', key: 'ProductID', keyType: 'Int32', // Other ODataStore properties go here }); // ===== or inside the DataSource ===== const dataSource = new DataSource({ store: new ODataStore({ url: 'http://www.example.com/Northwind.svc/Products', key: 'ProductID', keyType: 'Int32', // Other ODataStore properties go here }), // Other DataSource properties go here }); export default { // ... data() { return { store, // ===== or ===== dataSource } } } </script>React
// ... import ODataStore from 'devextreme/data/odata/store'; import DataSource from 'devextreme/data/data_source'; const store = new ODataStore({ url: 'http://www.example.com/Northwind.svc/Products', key: 'ProductID', keyType: 'Int32', // Other ODataStore properties go here }); // ===== or inside the DataSource ===== const dataSource = new DataSource({ store: new ODataStore({ url: 'http://www.example.com/Northwind.svc/Products', key: 'ProductID', keyType: 'Int32', // Other ODataStore properties go here }), // Other DataSource properties go here }); class App extends React.Component { // ... } export default App;ASP.NET MVC Controls
@(Html.DevExtreme().WidgetName() .DataSource(ds => ds.OData() .Url("http://www.example.com/Northwind.svc/Products") .Key("ProductID") .KeyType(EdmType.Int32) // Other ODataStore properties go here ) )
@(Html.DevExtreme().WidgetName() _ .DataSource(Function(ds) Return ds.OData() _ .Url("http://www.example.com/Northwind.svc/Products") _ .Key("ProductID") _ .KeyType(EdmType.Int32) _ @* ... *@ @* Other ODataStore properties go here *@ @* ... *@ End Function) )
To access an entire OData service, use the ODataContext instead.
The
ODataStoreis immutable. You cannot change its configuration at runtime. However, you can use its
methodsto manipulate it.
A 1-Click Solution for CRUD Web API Services with Role-based Access Control via EF CoreIf you target .NET for your backend API, be sure to check out Web API Service and register your free copy today. The Solution Wizard scaffolds an OData v4 Web API Service (.NET 6+) with integrated authorization & CRUD operations powered by EF Core ORM. You can use OAuth2, JWT or custom authentication strategies alongside tools like Postman or Swagger (OpenAPI) for API testing. The built-in Web API Service also filters out secured server data based on permissions granted to users. Advanced/enterprise functions include audit trail, endpoints to download reports, file attachments, check validation, obtain localized captions, etc.
To use the free Solution Wizard (which creates the Web API Service), run the Universal Component Installer from the DevExpress Download Manager and use our predefined template in Visual Studio 2022+.
Read Tutorial | View Examples: JavaScript (DevExtreme) & JavaScript (Svelte) | Watch Videos
See AlsoThis section describes the ODataStore's configuration properties.
Name Description beforeSendSpecifies a function that customizes the request before it is sent to the server.
deserializeDatesSpecifies whether the store serializes/parses date-time values.
errorHandlerSpecifies a function that is executed when the ODataStore throws an error.
fieldTypesSpecifies the data field types. Accepts the following types: "String", "Int32", "Int64", "Boolean", "Single", "Decimal" and "Guid".
filterToLowerSpecifies whether to convert string values to lowercase in filter and search requests. Applies to the following operations: "startswith", "endswith", "contains", and "notcontains".
jsonpSpecifies whether data should be sent using JSONP.
keySpecifies the key property (or properties) that provide(s) key values to access data items. Each key value must be unique.
keyTypeSpecifies the type of the key property or properties.
onInsertedA function that is executed after a data item is added to the store.
onInsertingA function that is executed before a data item is added to the store.
onLoadedA function that is executed after data is loaded to the store.
onLoadingA function that is executed before data is loaded to the store.
onModifiedA function that is executed after a data item is added, updated, or removed from the store.
onModifyingA function that is executed before a data item is added, updated, or removed from the store.
onPushThe function executed before changes are pushed to the store.
onRemovedA function that is executed after a data item is removed from the store.
onRemovingA function that is executed before a data item is removed from the store.
onUpdatedA function that is executed after a data item is updated in the store.
onUpdatingA function that is executed before a data item is updated in the store.
urlSpecifies the URL of an OData entity collection.
versionSpecifies the OData version.
withCredentialsSpecifies whether to send cookies, authorization headers, and client certificates in a cross-origin request.
This section describes the methods that control the ODataStore.
This section describes events that the ODataStore raises.
Name Description insertedRaised after a data item is added to the store.
insertingRaised before a data item is added to the store.
loadedRaised after data is loaded to the store.
loadingRaised before data is loaded to the store.
modifiedRaised after a data item is added, updated, or removed from the store.
modifyingRaised before a data item is added, updated, or removed from the store.
pushRaised before changes are pushed to the store.
removedRaised after a data item is removed from the store.
removingRaised before a data item is removed from the store.
updatedRaised after a data item is updated in the store.
updatingRaised before a data item is updated in the store.
Feel free to share topic-related thoughts here.RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4