Skip to content

The extension doesn't work when the DataTable is set to paginationServer and the data property between DataTableExtensions and DataTable differ #20

Open

Description

@mangowi

Hi,
Thanks for the nice extension.

I came to realize the extension fails to work when the pagination is from the server and the data property is length differ.

Scenario- Considering the pagination is from the server and the total number of data that we want to export is 800 while the total number of data that we want to display per page is 10.

This is my setup
const dataAll and const data are different in size and pagination is from the server.

 const tableData = {
    columns,
    data: dataAll,
    filterHidden: false,
    filter: false,
    exportHeaders : true,
    print: false
  };

  return (
    
   <DataTableExtensions {...tableData}>
    <DataTable
      title="Customers"
      columns={columns}
      data={data}
      progressPending={loading}
      pagination
      paginationServer
      paginationTotalRows={totalRows}
      paginationDefaultPage={currentPage}
      onChangeRowsPerPage={handlePerRowsChange}
      onChangePage={handlePageChange}
      selectableRows
      onSelectedRowsChange={handleChangeRowsSelected}
      contextActions={contextActions(sendEmailToSelectedContacts)}
      sortIcon={sortIcon}
      selectableRowsComponent={Checkbox}
      defaultSortField="FirstName"
    />
    </DataTableExtensions>
  );

Am I missing something?

Thanks

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions