You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is possible to display these datasets in a single datagrid conditionally by binding
rows = condition ? data1 : data2
and have a condition state on the page decide which dataset to show in the grid.
However, the columns definition is always static. It won't change when the dataset changes.
There are several ways in which the problem can be solved
1. make columns property bindable
Allow for binding the columns property to a json structure that represents the column definitions. Then one could use the same tactic as used in the rows to switch between columns
columns = condition ? data1 : data2
2. Expand data providers
Data providers represent backend data sets. At the moment they don't include any schema information. We could let the DataGrid accept Toolpad core data providers which do include a schema. We could make the dataprovider bindable so a user could switch between two of them conditionally on the grid.
Summary
I have two datasets that I'd like to show in a datagrid. Each dataset has a different shape. e.g.
It is possible to display these datasets in a single datagrid conditionally by binding
and have a
condition
state on the page decide which dataset to show in the grid.However, the columns definition is always static. It won't change when the dataset changes.
There are several ways in which the problem can be solved
1. make columns property bindable
Allow for binding the columns property to a json structure that represents the column definitions. Then one could use the same tactic as used in the rows to switch between columns
2. Expand data providers
Data providers represent backend data sets. At the moment they don't include any schema information. We could let the DataGrid accept Toolpad core data providers which do include a schema. We could make the dataprovider bindable so a user could switch between two of them conditionally on the grid.
Examples
No response
Motivation
https://discord.com/channels/1131323012554174485/1131329982669525015/1232708642701053983
Search keywords: data grid rows
The text was updated successfully, but these errors were encountered: