DevExtreme React - Custom Sources
DevExtreme provides the CustomStore component, a flexible instrument that allows you to configure data access manually, for consuming data from any source. The following extensions for ASP.NET and PHP servers simplify the task of configuring the CustomStore and implement server-side data processing as well:
You need to configure the CustomStore in detail for accessing a server built on another technology. Data in this situation can be processed on the client or server. In the former case, switch the CustomStore to the raw mode and load all data from the server in the load function as shown in the next example.
In the latter case, use the CustomStore's load function to send data processing settings to the server. These settings are passed as a parameter to the load function. In case of the Scheduler, the only relevant setting is filter, which is passed when the Scheduler's remoteFiltering option is set to true:
filter: Array
Defines filtering parameters. Present if the DataSource's filter option is set. Possible variants:Binary filter
- [ "field", "=", 3 ]
Unary filter
- [ "!", [ "field", "=", 3 ] ]
Complex filter
- [
- [ "field", "=", 10 ],
- "and",
- [
- [ "otherField", "<", 3 ],
- "or",
- [ "otherField", ">", 11 ]
- ]
- ]
See the Filtering topic for more details.
After receiving this setting, the server should apply it to data and send back an object of the following structure:
- {
- data: [ ... ] // result data objects
- }
If the Scheduler allows a user to add, delete or update appointments, the CustomStore must implement the insert, remove and update operations as well. Here is a generalized configuration of the CustomStore for the Scheduler widget.
See Also
If you have technical questions, please create a support ticket in the DevExpress Support Center.