Hello Flexmonster Team,
I am currently using a custom API with Vue.js as the client and exploring options for streaming data into Flexmonster. While reviewing the available configuration options, I came across the useStreamLoader property.
Could you please elaborate on how useStreamLoader works internally? I would also appreciate an explanation of how it differs from using a native fetch approach for loading or streaming data, and in which scenarios it is recommended to use it.
Thank you for your time and support.
Hello, Abbas!
Thank you for reaching out to us.
Kindly note that our stream loader feature is available for the JSON data source only, so that users without a server-side solution can work with bigger JSON files directly from the browser. The useStreamLoader option uses the native stream loader to load JSON file in chunks under the hood.
If you are using the custom data source API as a function approach and want to send data in chunks, we would recommend loading data by pages. For that, please specify the page and pageTotal properties in your /select response. After that, the component will continue sending the /select requests while the page is less than the pageTotal.
To check out the sample request and response with page and pageTotal properties, please look through example 5: https://www.flexmonster.com/api/select-request-for-pivot-table/.
Hope you will find our answer helpful.
Feel free to ask if you have any further questions.
Kind regards,
Solomiia
Hello, Abbas!
Hope you are doing well.
Our team is wondering if you had some time to check out our previous email. Could you please let us know if the suggested approach of loading data by pages with custom data source API as a function was helpful?
Looking forward to hearing from you.
Kind regards,
Solomiia
Hello,
It worked, but I have one question. If the total data size is 1000 and the chunk size is 100, it should make 10 API calls, correct? However, it’s making more than that, and I don’t understand why this is happening.
Hello, Abbas!
Thank you for your feedback.
We’re glad to hear that the pages functionality works well for you.
Regarding your question about the component sending more requests than expected, could you please provide a bit more detail about the behavior you’re observing? In particular, it would be helpful to understand how the number of requests compares to the pageTotal value specified in the request, and whether any page numbers are duplicated or exceed pageTotal.
This information, along with examples of both the expected and the redundant requests, would help us investigate the issue further.
Looking forward to hearing from you.
Kind regards,
Solomiia