Server Side Pagination triggering two server calls

1 Answer 81 Views
Grid
Mahesh
Top achievements
Rank 1
Iron
Mahesh asked on 12 Oct 2023, 02:23 AM

ProductLoader holds the server-side data, every page loads and based on filter change the call is triggered two times.
It works this way in my app as well as the pagination demo.

Is this something that is implemented the same at the moment?

https://www.telerik.com/kendo-react-ui/components/grid/data-operations/odata-server-operations/

stackblitz - https://stackblitz.com/run/?file=app%2Fmain.jsx

1 Answer, 1 is accepted

Sort by
0
Accepted
Konstantin Dikov
Telerik team
answered on 13 Oct 2023, 07:36 AM

Hello Mahesh,

This seems to be an issue with stackblitz, because testing the demo on our side evokes only one request. Additionally, if you add console log within the fetch logic (or just before it), you will notice that it is executed only once:

  const requestDataIfNeeded = () => {
    if (
      pending.current ||
      toODataString(props.dataState) === lastSuccess.current
    ) {
      return;
    }
    console.log('fetch');
    pending.current = toODataString(props.dataState);
    fetch(baseUrl + pending.current, init)

Could you please check if the code is executed two times in your app?

 

Regards,
Konstantin Dikov
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources!

Mahesh
Top achievements
Rank 1
Iron
commented on 13 Oct 2023, 01:24 PM

I was checking in the localhost server, and it was triggering two times. 

After deployment to the dev and QA instances, it triggers only once.

Thank you

Tags
Grid
Asked by
Mahesh
Top achievements
Rank 1
Iron
Answers by
Konstantin Dikov
Telerik team
Share this question
or