Skip to content
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

PaginatedDataTable and paginated data from the server #87348

Open
ghost opened this issue Jul 30, 2021 · 20 comments
Open

PaginatedDataTable and paginated data from the server #87348

ghost opened this issue Jul 30, 2021 · 20 comments
Labels
c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. team-design Owned by Design Languages team triaged-design Triaged by Design Languages team

Comments

@ghost
Copy link

ghost commented Jul 30, 2021

Hi!!
Does it make any sense that the PaginatedDataTable widget doesn't support paginated data from the server instead of fetching all the data?
When the tables on the server are very large, which happens most of the time, the correct thing to do is to take the data as it is being displayed.
Thanks a lot.

@darshankawar darshankawar added the in triage Presently being triaged by the triage team label Aug 2, 2021
@darshankawar
Copy link
Member

@Josua2012
There's this community plugin which seem to handle such scenario, https://pub.dev/packages/advanced_datatable
Check it out and see if it answers your question. Also check this article for your further reference https://levelup.gitconnected.com/server-side-paginated-data-table-in-flutter-d01b16f30f3

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Aug 2, 2021
@ghost
Copy link
Author

ghost commented Aug 2, 2021

I had seen this widget, but it doesn't work too well, it has problems, and the logical thing is that the Flutter PaginatedDataTable widget included this functionality. It is an essential functionality that should have been included from the beginning. I do not understand how it has not been included. :(

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Aug 2, 2021
@darshankawar
Copy link
Member

Check this open proposal and see if it'll help to answer your question.

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Aug 2, 2021
@ghost
Copy link
Author

ghost commented Aug 2, 2021

From what I see it is a request that other users also have. It is normal. It is an essential feature for working with any data source, since you can never know if it will contain many or few rows, and it is not admissible, nor logical, to work with all the rows in memory.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Aug 2, 2021
@darshankawar
Copy link
Member

How's the current behavior when data is being showed from the server ? Does it not show as-is ?

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Aug 2, 2021
@ghost
Copy link
Author

ghost commented Aug 2, 2021

The current behavior is that all rows are fetched from the server.
The desired behavior is that it only get the rows of the page that is being displayed.
If there are a million rows on the server, it would only take the rows that are being seen in the widget, for example, if the page is 30 rows long, it would only get 30 rows from server.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Aug 2, 2021
@darshankawar
Copy link
Member

Keeping this issue open for further insights from the team and labeling it as a proposal.

Reference: #87348 (comment)

Cc: @HansMuller

@darshankawar darshankawar added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. passed first triage c: proposal A detailed proposal for a change to Flutter c: new feature Nothing broken; request for a new capability and removed in triage Presently being triaged by the triage team labels Aug 3, 2021
@jagadishnallappa
Copy link

Hi, any news as to when this will be supported?

@Patrick386
Copy link

This function must be supported. When will it be possible?

@james-poulose
Copy link

Waiting for this feature!

@chhinsras
Copy link

Any update server side tendering

@Conezi
Copy link

Conezi commented Dec 13, 2022

onPageChanged: (firstIndex){
if(firstIndex + _rowsPerPage >= data.length){
//Load more
}
}

You can try loading more data than you render per page, then use the above lines of code to load more data before/when it runs out.

@rsiva229
Copy link

This is a good workaround but what will you do about the wrong number of records being shown in the footer?

It is sure to mislead the user into thinking that there are only less number of records present.

@lleandroo93

This comment was marked as duplicate.

@ghost

This comment was marked as duplicate.

@darshankawar
Copy link
Member

Please upvote the original issue description and avoid commenting +1 or asking for updates. The team also prioritize the issue based on number of upvotes.

@ercantomac
Copy link

At least we should be able to make the getRow() function asynchronous inside our DataTableSource class:

@override
  DataRow getRow(int index) async {
    await fetchPaginatedData();
    return DataRow(
      cells: <DataCell>[
        ...
      ],
    );
  }

@francois-robert
Copy link

Waiting for this as well

@BangPei
Copy link

BangPei commented Jul 2, 2023

@Josua2012 There's this community plugin which seem to handle such scenario, https://pub.dev/packages/advanced_datatable Check it out and see if it answers your question. Also check this article for your further reference https://levelup.gitconnected.com/server-side-paginated-data-table-in-flutter-d01b16f30f3

Thanks, it works for me.

@flutter-triage-bot flutter-triage-bot bot added multiteam-retriage-candidate team-design Owned by Design Languages team triaged-design Triaged by Design Languages team labels Jul 8, 2023
@Jarcccmd
Copy link

Jarcccmd commented Aug 4, 2023

Waiting for this feature!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. team-design Owned by Design Languages team triaged-design Triaged by Design Languages team
Projects
None yet
Development

No branches or pull requests