Mewriick / Blazor.FlexGrid

GridView component for Blazor
MIT License
199 stars 35 forks source link

Master Detail datagrids questions #65

Closed githubfanster closed 5 years ago

githubfanster commented 5 years ago

The context for this question is that my app is a server-side blazor app, and i'm not loading data lazily thru an api, so no LazyTableAdapters.

If a Master row does not have an associated Details subgrid (for example, a customer currently does not have orders), is it possible to have the renderer make the '>' icon invisible so users dont even get to click on it only to get the "Loading ..." text, which may be mistakenly interpreted as "there are data to be loaded so please wait" as opposed to "there's really no associated details data to show"?

Can the table builder be given some sort of Options object to specify this?

If not, could you please consider supporting this feature? Thanks!

Mewriick commented 5 years ago

This will be tricky because, when the icon is renderer FlexGrid does not know if in detail DataAdapter are some data. So for speed purposes I have to still render the icon, but after this correct message will be displayed.

githubfanster commented 5 years ago

i'm not familiar with your code yet, so i can't help you yet. but it sounds like you're proposing that if the Master row really has no associated details to show, something like a "No data to show here ..." will be displayed instead of the more ambiguous "Loading ..."?

i guess that's fine with me for now.

i was going to ask: once you've determined this no data to show condition can you make the '>' icon invisible at that time, some sort of post-processing? but i'm not sure if that's a good idea. i guess it depends on if it's going to make a good user experience

Mewriick commented 5 years ago

Yes you are corret. Also considering that this message will be configurable.

The problem with removing the '>' icon is that FlexGrid only knows that there is some DataAdapter associated with this item and after icon is clicked the DataAdapter is converted to the DataSet with items. And after that count of items is known (now this happen only if you click on the icon or in some other tab in details view). If I have to do this for every row which will be renderer the rendering will be very slowly because converting DataAdapter to DataSet could be time consumption especially in cases where DataAdapter is LazyDataAdapter.

I also considering to create some adapter for localization texts in grid.

githubfanster commented 5 years ago

ok, i understand. thanks for the explanation

Mewriick commented 5 years ago

In new version you can now configure message when grid is empty (or use default "No data to show here ...").

 builder.HasEmptyItemsMessage("<h1>Message</h1>");
githubfanster commented 5 years ago

thank you