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
If TableData<T>.Items is an IEnumerable<T>, context state cannot be modified.
Background
I have a MudTable which receives data from my server. Each row has a button which expands or collapses the row.
This was working perfectly until I performed client-side transformation of the table data prior to population in the MudTable - and critically, not converting the resultant IEnumerable<T> to a List<T> in my ServerData callback when setting TableData<T>.Items.
The resultant behaviour was that the table rendered fine, however the context passed to my row expander was the original model state - i.e., any changes to the model in code (i.e., toggling an expanded state boolean on my model) - weren't reflected.
Expected behavior
If the ServerData function sets an IEnumerable<T> on TableData<T>.Items, the MudTable should still work fully.
Reproduction link
Can write if required - I believe the context of the bug report is hopefully sufficient
privateasyncTask<TableData<ClientMessageSummary>>SearchAsync(TableStatestate){// Retrival code removed for clarityreturnnewTableData<ClientMessageSummary>{Items= response.Messages.Select(ModelMapper.Map),// BUG - IEnumerable due to `Select()`TotalItems= response.NumMessages
};}
Relevant log output
No response
Version (bug)
6.15.0
Version (working)
No response
What browsers are you seeing the problem on?
Edge
On which operating systems are you experiencing the issue?
Windows
Pull Request
I would like to do a Pull Request
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
Please create a trymudblazor recreating this. I could not recreate the issue and it doesn't sound like an issue with using IEnumerable instead of List (unless MudBlazor was somehow and for some reason creating deep copies of your objects).
Bug type
Component
Component name
MudTable
What happened?
Summary
If
TableData<T>.Items
is anIEnumerable<T>
, context state cannot be modified.Background
I have a MudTable which receives data from my server. Each row has a button which expands or collapses the row.
This was working perfectly until I performed client-side transformation of the table data prior to population in the MudTable - and critically, not converting the resultant
IEnumerable<T>
to aList<T>
in myServerData
callback when settingTableData<T>.Items
.The resultant behaviour was that the table rendered fine, however the context passed to my row expander was the original model state - i.e., any changes to the model in code (i.e., toggling an expanded state boolean on my model) - weren't reflected.
Expected behavior
If the
ServerData
function sets anIEnumerable<T>
onTableData<T>.Items
, theMudTable
should still work fully.Reproduction link
Can write if required - I believe the context of the bug report is hopefully sufficient
Reproduction steps
Relevant log output
No response
Version (bug)
6.15.0
Version (working)
No response
What browsers are you seeing the problem on?
Edge
On which operating systems are you experiencing the issue?
Windows
Pull Request
Code of Conduct
The text was updated successfully, but these errors were encountered: