-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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] Allow iterator or iterable as rows #10969
Comments
Can you provide an example? |
Sure, updated the issue. |
Another solution would just be to allow this type of scheme as data source. |
I'm not favorable to this feature. Converting from iterator to array is trivially done outside of the grid. Having array rows isn't just about iteration for the grid, it's about having a way to do random access and addressing. Iterators aren't built for that purpose. Ping @mui/xgrid if anyone else has an opinion here. @daniatic If the conversion is expensive, it means you probably already have big costs for your data transfer, and you might benefit from looking into server-side data, pagination and/or lazy-loading. |
It also seems that using rows with the format Note that in JS, |
Of course, we use server side pagination to mitigate the data transferred. But assuming that solves the problem is too short-sighted. In cases of many client requests there would still be a ton of unneccessary redundant data sent over the wire. Maybe redundant data is no problem (still careless in my opinion) for simple applications, but for data intensive services it is a no go. You could argue to burden that mapping onto client but this seems careless in my opinion, too.
Looks promising. Does this come with feature parity, compared to the "normal" way? |
I don't see any reason for it not to work, if you find a bug please report it. Does that solve your issue here? I don't see how iterators could make things more efficient here. Could you provide an example of how iterators could improve things? |
I haven't tried the Besides that I think that iterators could help in scenarios where the server-side data does not come in the needed format and you don't want to waste resources on iterating it an additional time. Nearly every data grid I worked with uses the built-in langauage features/iterators to solve these scenarios: In my eyes that's a very basic feature of a data grid. |
Considering that the use-case you have is already supported by the datagrid, I don't see a different use-case that needs to be solved here. We can't use iterators directly in the grid because as I said we need random-access in If what you're after is more lazyness, then you can always provide all your columns with a I'd say if you want us to do something here, provide us with a use-case where we can see clear tangible performance benefits, we'll consider it. |
All right! Thanks for feedback. If our use cases changes/demands something similar in the future, I'll let you know. |
I'll close for now, open again if you have more to add. |
Summary 💡
I'd like to provide an iterator/iterable as rows instead of an array of objects.
Examples 🌈
Following data is served from the server:
Just send whats needed! Why send redundant data over the line?
With an iterator/iterable I could provide a mapping function that maps each row on interation.
Motivation 🔦
Data is not always served in the required scheme. Therefore the data has to be iterated expensively in order to map it into the required schema. Only to be iterated again for display.
Search keywords: datagrid rows
The text was updated successfully, but these errors were encountered: