Okay so here's a unique situation. I'll describe it carefully.
ASK: A custom adaptor that binds data to an external source using a function instead of a URL or query.
or
ASK: A custom adaptor that uses query libraries such as Tanstack Query to retrieve the data from the source.
The reasons behind my ask:
Hi Jeremy Brown,
The DataManager can connect to a remote data source by assigning the service endpoint URL to the 'url' property. The DataManager manages all interactions with the data server using queries. Different remote services have varying methods for accepting requests and returning responses.
The URL Adaptoror is employed when dealing with a RESTful API that adheres to a specific URL format for performing CRUD operations (Create, Read, Update, Delete).
OData serves as a standardized protocol utilized for generating and utilizing data APIs online, enabling CRUD functionalities. This adapter manages incoming requests and outgoing responses in accordance with the OData protocol, encompassing tasks such as filtering, sorting, paging, and more.
OData V4 represents an updated iteration of the OData protocol, providing more features and improvements over the previous versions. It supports advanced querying capabilities and ensures compatibility with services that adhere to the OData V4 specification.
The Custom Adaptor enables you to establish your unique set of instructions for data retrieval, manipulation, and CRUD (Create, Read, Update, Delete) operations.
We reviewed your query, To create a custom adapter in Syncfusion that binds data to an external source using a function instead of a URL or query, you would need to extend the base `Adaptor` class and implement the necessary methods to interact with your data source.
Please refer to the below Documentation link more information.
Documentation link
Sample : 48qxqr (forked) - StackBlitz
Please get back to us, if you need further assistance.
Regards,
Johnson Soundararajan S
I have the same questions, the reply is repeating the documents, which didn't help in the first place.
How can DataManager consume data from an async function and not an url?
Hi Karin,
Based on the provided information, we have observed that you wanted to consume data from an asynchronous function rather than using a URL. In Syncfusion DataManager, each adaptor has its own structure, the URL property being essential for processing all server-side methods. Please refer to the given documentation link for more detailed information.
Before we can offer a solution tailored to your requirements, we need some additional information. Kindly provide the following details to help us deliver an optimal solution:
1. Details about the asynchronous function used, including the format of the returned data. Also please share your exact requirement in detail.
2. Specify the component to which you want to bind the resultant data from the custom data source and describe how you are binding the data to that specific component.
3. Information on the amount of data being returned by the asynchronous function.
4. If you are binding the data to a Syncfusion component, please share the complete rendering code of the component along with the version of the package in use.
5. Specify the data actions that you wish to perform with the component.
Providing these details will greatly assist us in sharing a more suitable solution for your requirement.
Documentation Link: Adaptors
Regards
Aishwarya R