Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[DataGridPro] Implement Lazy loading #5214
[DataGridPro] Implement Lazy loading #5214
Changes from 13 commits
ad7e2da
c214c93
93af334
55948da
bd6f534
8db28de
29eafb9
cc4019f
0fc1bfc
2fe5b7a
7da81c2
82796fa
dd901a2
a5dfc0a
692f4f4
9abed60
0be892f
f565260
4e66d70
0fa4d64
67b2141
cdacca9
ac2b4d8
27d44f8
e4c3a68
aa995b8
37f8117
e53ca5b
4038f5d
f880252
a61e86c
c4a9343
cd87b6c
4a31d2f
fa8114f
6dd928b
875bd0c
877a117
3fc84ff
42e11ee
aac485f
8906b83
6ef5dc1
9bd6a08
9dab887
5b946e3
e2661ce
fedb8c5
26a42ed
f0c9393
09ad985
ead9b2a
0139c01
57f07c9
d890470
5bd7d0d
801b443
1f1074e
acdcb76
c8f46e9
f55e7fe
e1a8044
1d845d0
f0aeea7
dc4e50b
90e1903
61be031
7d5e427
d6b536f
0adb7ef
65e522b
9a88194
2dafe3a
d781e29
4491fb4
6cf0cf9
39ad75f
c563079
fa846a6
f381442
924cf66
74200f4
7512a8f
3d12945
69b0595
17def05
79eb868
88ea46f
3724946
38be38d
5a7905e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe call
getRealGridData
only once, before the grid is loaded, then slice it here to get only the portion needed. This is to avoid replacing already loaded rows with different data.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to use the fake server that @alexfauquette created but it didn't work in this case. The problem was that the hook triggers a rerender and that was not ideal. I spent some time to try and work around the problem but ultimately gave up on that approach.
It would have been nice if I was able to make it work because then the filtering and sorting would also work.
Regarding the "jump" - I investigated further and it's not really a jump. As far as I understand the issue is with the way the
getRealGridData
returns new data. If I just create some static arrays with IDs from 1 to 30 and load those on chunks then it works as expected.I can try and load preload all the rows but then how do we react to filtering and sorting?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After reading this section and the demo, I'm wondering how often the
onFetchRows
is called and should I handle by myself to do not call the server if I already have all the rowsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If all the rows are loaded the
onFetchRows
won't be called.One optimization that is needed by the user is to implement throttle because now this callback is being called a lot while scrolling.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to fetch for each row that becomes visible in the viewport. In practice, it's probably not usable in production in the current shape as it would flood the server API.