-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[DataGrid] Lazy loading, Infinite Loading #404
Comments
We already handle server-side pagination: https://material-ui.com/components/data-grid/pagination/#server-side-pagination. You can override the number of rows in We don't have the infinite scrolling behavior, which will consist of hooking the virtualization to the user server, so we will tell the server which index range we need to render. |
We just started using XGrid and it's a terrific component! But no infinite scroll API is disappointing to see - we happen to utilize infinite scroll over pagination in most of our app. We've been using this library for infinite scrolling needs. Perhaps something to benchmark? |
@austinlangdon Glad to have you as a user, and thanks for the feedback. We do try to make it clear that the product is still in development, both on the product page in the store, and in the documentation. Is there something we should change to make that clearer? |
I was going through the docs and this was not clear to me either. |
@austinlangdon can you share how you used xgrid with |
@vd-yasir Our solution was to update our API request to get a large amount of data from our API as recommended (~1000 records). Most likely the user will never scroll past the first couple hundred rows |
As I started working on this problem it would be interesting to hear what are your thoughts on the infinite/lazy loading with a combination of the |
I don't think so, it doesn't make any sense to me. IMHO autoHeight if meant to reduce the gap with a regular/simple |
After discussing it further this is what it will be delivered in the first iteration:
|
I would propose we add it into https://material-ui.com/components/data-grid/rows/#updating-rows as it also where we document the streaming. Considering that pagination over 100 rows is only available in the Pro plan. We can either have this feature inside DataGrid or XGrid. I don't have any preferences. DataGrid maybe for the sake of covering developers that don't/can't load 100 rows as we have seen many times in the Autocomplete: mui/material-ui#18450? |
A subset of the issue was fixed, the cursor pagination with infinite loading. We have #1247 as a follow-up. It's not very clear to me, but #1247 might be what most developers are looking for. I'm not soo sure. With PostgreSQL when you have 10,000 rows, it's quite easy to get a total row count. However, when you have 1,000,000 rows, it becomes a real challenge ( |
It's 10 months later, but just to leave a comment - naively counting rows will most likely lead to performance problems. However, there could be always a way to optimize the row count query, and if all fails, PostgreSQL, Oracle, but also some other RDBMSs have an option to deliver estimated row count which should fire up in milliseconds. I think if someone wants to use it, then let them. The performance penalty goes on them. |
Summary 💡
Provide a way to only load a fraction of the data, to prioritize data loading for the visible parts of the screen without pagination.
Examples 🌈
During the very first iteration on the data grid mui/material-ui#18872, we come up with the following API:
Where the
dataProvider
default to a value dedicated to client-side operations with therows
prop. It can probably be improved.Motivation 🔦
It's a sub-problem of #240.
Benchmark
The text was updated successfully, but these errors were encountered: