I am using Flutter 3 with Flutter Data Grid. My problem is:
"i Want to load asynchronous data", for which i duly followed tutorial at this page:
Paging in Flutter DataGrid | DataPager | Syncfusion
However, when the handlePageChange is called, the asynchronous data is loaded, it again calls it, and keeps calling onRowChange without me even touching the table.
Here is how i am implementing it :
Hi Afzaal,
Unfortunately, we are not able to run your sample as we got
issues with your sample. So, we prepared a new simple sample based on your
requirement. In our simple sample, we could not reproduce your mentioned issue.
Please refer to the below sample,
https://www.syncfusion.com/downloads/support/directtrac/general/ze/sfdatapager_sample-117547246
If possible, please modify the above simple sample to meet your requirement. It will be helpful for us to check this issue and provide you the solution at the earliest
Regards,
Ashok K
I am doing it the same way but as you can see in my data source, i have a PRINT statement that shows how many times the handlePageChange method is called. This happens all of a sudden, NOT always. Occasionally if i tamper with a variable or change a logic.
However, As far as i see, when it happens, it goes into infinite loops , which means, it keeps on fetching from my API till i change Page/Route or Hard Refresh the state. Now i am not sure if this is normal in debug mode but i am unable to fix it.
Hi Afzaal,
Thanks for your update.
We suspect the infinite loops can be triggered due to the data fetching process from web API. Can you please share your working sample application to check this issue at our end? Because it will be helpful for us to debug and find the root cause as early as possible.
Regards,
Ashok K
Hello, i got a error like this, when i try to fetch data from backend in handlePageChange, table loads data in infinity loop
Yusif, based on the provided information we are unable to reproduce the reported issue. It's working fine on our end. Can you please share the sample which you are facing the issue with? It will be helpful for us to check and provide the solution as soon as possible.
Yusif were you ever able to figure this out? I'm starting to run into an infinite loop too
I have the same issue
Hi Trung Bui,
Based on the provided code snippet, we are not entirely sure about the issue you are facing and the root cause. It would be more helpful for us if you could provide a sample that reproduces the issue. This will enable us to run the code and effectively diagnose the problem to provide you with a prompt solution.
However, based on our initial analysis, we suspect that the issue might be related to the implementation of the `DataGridSource.handlePageChange` method. When overriding this method, it is necessary to return either `true` or `false` to manage page changes. It's crucial not to call the super method within this override. We recommend reviewing and modifying the `DataGridSource.handlePageChange` method to directly return `true` or `false` instead of invoking the super method.
Regards,
Tamilarasan