Megabit / Blazorise

Blazorise is a component library built on top of Blazor with support for CSS frameworks like Bootstrap, Tailwind, Bulma, AntDesign, and Material.
https://blazorise.com/
Other
3.18k stars 517 forks source link

DataGrid: Dynamic data support through ExpandoObject #5507

Closed David-Moreira closed 3 weeks ago

David-Moreira commented 1 month ago

While it wasn't that hard to integrate the loading of data. I found it might be a bit limited regarding the edit operations. This is because due to the dynamic nature, we can't really figure out the Type of a particular field without having an actual structure.

This means that when editing: We need to infer from the actual item field type in order to know what input to render (numeric, checkbox, etc), so this means a nullable won't be easily figured out, if the value is null, there's no way you can tell which type would be in this particular field for example. So the TypeGetter method was updated to include the Item as a parameter to look into it. image

When creating: We need to override the NewItemCreator and provide the structure so the Grid can figure out the inputs to render, checkboxes, numeric, etc... image

What are your thoughts?

stsrki commented 1 month ago

While it wasn't that hard to integrate the loading of data. I found it might be a bit limited regarding the edit operations. This is because due to the dynamic nature, we can't really figure out the Type of a particular field without having an actual structure.

This means that when editing: We need to infer from the actual item field type in order to know what input to render (numeric, checkbox, etc), so this means a nullable won't be easily figured out, if the value is null, there's no way you can tell which type would be in this particular field for example. So the TypeGetter method was updated to include the Item as a parameter to look into it. image

When creating: We need to override the NewItemCreator and provide the structure so the Grid can figure out the inputs to render, checkboxes, numeric, etc... image

What are your thoughts?

If there is no other option I don't see any objections regarding this. As long as it doesn't affect the current work.

David-Moreira commented 1 month ago

Well, I believe, this is it. What do you think?

David-Moreira commented 1 month ago

Friendly reminder

stsrki commented 1 month ago

There are conflicts now.

David-Moreira commented 1 month ago

There are conflicts now.

Done.

David-Moreira commented 3 weeks ago

@stsrki Friendly reminder

David-Moreira commented 3 weeks ago

LGTM. If you don't plan to add anything else I will merge it.

I am ok with the feature for now. Better have it introduced and get feedback from users using it then to overdo it.