material-table icon indicating copy to clipboard operation
material-table copied to clipboard

Custom Export function does not include all Data

Open domisProgrammingMemes opened this issue 5 years ago • 1 comments

  • I created a custom export function which works except for the fact, that it does not recognise the option "exportAllData" value.
  • The data is dependant on the amount of rows rendered
handleExportCsv = (columns, data) => {
    // this shoud include all rows right?
    console.log(data, 'rows')
  }

options={{
   columnsButton: true,
   exportButton: {
       csv: true,
       pdf: false,
      },
   exportFileName: 'export-file',
   grouping: false,
   actionsColumnIndex: -1,
   sorting: false,
   exportAllData: true,
   loadingType: 'overlay',
   pageSize: this.state.pageSize,
   pageSizeOptions: [20, 50, 100, 200, 500],
   paging: true,
   search: false,
   tableLayout: 'auto',
   draggable: false,
   exportCsv: this.handleExportCsv,
}}

data={query =>
        new Promise((resolve, reject) => {
           // prepare your data and then call resolve like this:
           resolve({
              data: // your data array
              page: // current page number
              totalCount: // total row number
              });
         })
}

Is this not working because my data is queried?

domisProgrammingMemes avatar Sep 14 '21 11:09 domisProgrammingMemes

just found out it is due to my data query

domisProgrammingMemes avatar Sep 14 '21 12:09 domisProgrammingMemes