Hi, I wanna create a paginated store list in which it will show the row data according to rowperpage. The storelist will connect will the firebase directly, which means at page 1, it will retrieve 3 stores data from firebase and show in the page. Everytime press the next page, it will retrieve another 3 stores data from firebase. When we reverse back from page 4 to page 2, it will show the previous content in page 2.
Beside, when we add/edit/delete the store data in firebase, the latest store list will be updated too.
Currently the first problem in my code is I able to fetch data into paginated view for page 1,2,3 and more. But when I want to reverse back from page 3 to page1, it will show nothing...
Second problem is everytime add/edit/delete, the data in firebase need to update synchronize also, so i still not sure how to do it....
Hi WONG PEI SAN,
Regarding: Currently the first problem in my code is I able to fetch data into paginated view for page 1,2,3 and more. But when I want to reverse back from page 3 to page1, it will show nothing.
To meet your requirements of loading
data from Firestore, you can retrieve the necessary data from Firestore within
the `DataGridSource.handlePageChange` method and construct the rows for the relevant page. We
have attached a simple
sample that demonstrates how to load data from Firestore into a Paginated DataGrid.
Please refer to the attached sample for a more comprehensive understanding of
the process.
Regarding: Second problem is every time add/edit/delete, the data in firebase need to update
synchronize.
We have already published a Knowledge Base (KB) document that provides
step-by-step instructions how to load data from Firestore to Flutter DataGrid along with the CRUD operations. Please check the following KB document for more
information.
KB document: https://support.syncfusion.com/kb/article/11968/how-to-load-data-from-firestore-to-flutter-datatable-sfdatagrid
Regards,
Tamilarasan