I am facing a problem and can't solve it. I have an EndPoint to retrieve data for my PivotTable, I can't use the standard URL to retrieve the data because I need to call it through my API Client.
For this, following the recommendation from the documentation, I created my own Adaptor for the DataManager and tried to make it return the data. However, when using my Adaptor, it starts to be called endlessly, meaning processQuery is called several times in a second and never stops. If I use a normal URL and a standard adapter, I get a response immediately and only 1 time. So I'm wondering what the problem is, are there any practical examples of using my adapter? Maybe there is some other way to use my EndPoint with ApiClient? Below I provide some parts of the code that may help:
Another try:
If instead of object I'll pass there just list of data it called just once
Hi Nikita,
Thank you for sharing the code example. We understand that you are currently facing an issue where the processQuery method is triggered multiple times when using a custom adaptor that extends WebApiAdaptor. If this is the case, we were able to reproduce the issue on our end and are actively investigating to identify the root cause. We will provide further updates within two business days, by May 29, 2025.
We appreciate your patience until then.
Regards,
Sridhar Karunakaran.
Hi Nikita,
Thank you for your continued patience.
After reviewing your latest code example, we observed that the data passed to the onSuccess method is returned as an object containing both result and count properties. We’d like to clarify that the Pivot Table component expects the data source to be either an list of objects or CSV data—not wrapped within another object.
When the data is returned in a wrapped format, the engine does not initiate its processing logic, which leads to the issue you're encountering. To resolve this, please ensure that the data is returned directly as a flat list of objects, as demonstrated in your alternate example.
This approach ensures that the Pivot Table engine receives the data in the expected format and processes it correctly.
Code example:
|
const remoteData = React.useMemo(() => { return new DataManager({ adaptor: new CustomDataAdaptor({ getData (option: FetchOption) { let request: object; GetPivotData(1074, 5089) .then((data) => { console.log({ result: data, count: data.length }); option?.onSuccess?.(data); }).catch((error) => { option?.onFailure?.(error); }); }, }), }); }, []);
|
Output screenshot:
In the meantime, we’ve prepared a sample based on the provided code for your reference. Please find it attached below.
Regards,
Sridhar Karunakaran