-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data grid Pagination #2
Data grid Pagination #2
Conversation
This commit changes the default of the DataGrid to be typescirpt as discussed
ad28865
to
21ef6b6
Compare
Thanks, I was just starting looking at it :) |
I was thinking of the following API:
|
I have pushed my latest changes. |
I will adjust the names. |
Yes I will spend time on it . Thanks for the feedback. |
0b4f3c0
to
77dcba8
Compare
77dcba8
to
f142dc1
Compare
Co-Authored-By: Olivier Tassinari <olivier.tassinari@gmail.com>
…ial-ui into oliviertassinari-data-grid
This commit finishes the inital pagination. It also let the user load more data when the last page is reached and the external data provider has loadMoreData
@oliviertassinari , I did more work on the pagination. |
Hi wow that's a detailed code review. Thanks. |
What about this new API proposal? defaultRowsPerPage?: number;
pagination?: number;
paginationRowsPerPageOptions?: Array<number | { value: number; label: string }>;
// and later, unless you want to implement it directly :)
defaultPage?: number;
rowsPerPage?: number;
page?: number;
onRowsPerPageChange?: React.ChangeEventHandler<HTMLTextAreaElement | HTMLInputElement>;
onPageChange?: (event: React.MouseEvent<HTMLButtonElement> | null, page: number) => void; |
Thanks for the synchronization of the branch with the main one :). I'm curious, did you consider to squash and rebase? Sometimes, I feel it's simpler, but we will see, maybe not. |
I failed the rebase... |
@Domino987 No problem, hold on. I think that we can continue working on it, then squash and rebase with GitHub. We can probably save time here :). Let's ignore my comment, for now. |
@Domino987 Thanks for taking my feedback into account! I have pushed the changes one step further. Here is a summary:
Let me know what you think of the changes :). As a follow-up, I think that it would be great to introduce the "of more" concept, as you can see in Google Ads or Ag-grid: For the implementation, maybe a |
Hello @oliviertassinari ,
this PR adds the pagination functionality to the data grid.
It saves the current page and pageSize and show the data with regard to changes made by the user.
It also lets the user to set the inital page, the page size and page size options.
What do you think?