gregnb / gregnb/mui-datatables

[Guidance] - Override Default Pagination Behavior

Open
#1,697 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.7k
Forks
906
PR merge metrics
No merged PRs in 30d

Description

## Expected Behavior

I want to be able to enable user-triggered api calls while using the other built-in pagination feature of the datatable.

For context, I want to be able to dynamically load additional data into the datatable through data fetch api calls as the user clicks through the pagination. So I want to override not only the viewed numbers in the pagination settings but also add custom actions when the user paginates to certain page number that will invoke additional data fetches.

Desired Workflow:
1) Table is first loaded based on initial api call that pulls 100 rows.
2) Pagination settings at 10 rows per page shows 1-10 of
3) User paginates past page 91-100.
4) Api call invoked to fetch more data and add to the data table.
5) Data is dynamically added allowing user to continue paginating forward once the call is finished.

## Current Behavior
Datatable's pagination setting numbers is based on data passed in on the initial fetch and strictly what's stored in memory.

## Steps to Reproduce (for bugs)

Not applicable as it is isn't a bug. But happy to put together a sandbox if it will help.

1.
2.
3.
4.

## Your Environment

Node express backend server and front end app running on container using node version 12.0.0.

| Tech | Version |
|--------------|---------|
| Material-UI | ^4.11.3 |
| MUI-datatables | ^3.7.6 |
| React | ^16.14.0 |
| browser | Chrome, Safari |
| material-ui-flat-pagination | ^3.2.0 |

Thank you very much for your time.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.