Server Side Pagination not exporting the updated grid data

1 Answer 47 Views
Grid
Mahesh
Top achievements
Rank 1
Iron
Mahesh asked on 12 Oct 2023, 02:37 AM | edited on 12 Oct 2023, 05:02 AM

Initial Data is exporting but after changing the page, the updated grid data not exporting.

It's returning the same old data or blank.

Is it the expected behaviour?

Reference -  https://stackblitz.com/edit/react-ajxmvq-gltk6x?file=app%2Fmain.jsx

 

1 Answer, 1 is accepted

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

Hello Mahesh,

If you inspect the _export.current within the excelExport you will notice that the data for the next page is actually available, but since the "products" object will be with {data, total} structure, the excelExport will fail to get the items after paging. Changing the ExcelExport configuration to the following will resolve the issue:

  return (
    <div>
      <ExcelExport data={products.data} ref={_export}>

Another option would be to explicitly add the data within the "save" method as shown below:

  const excelExport = () => {
    if (_export.current !== null) {
      _export.current.save(products);
    }
  };

Here is the modified example:

Hope this helps.

 

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:22 PM

Thank you so much :)

I am able to download it now.

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