MatBlazor
MatBlazor copied to clipboard
MatTable - A way to return the Selected @context.Id?
Hi,
I was looking for a way to return a selected row so I can navigate to the details page. Is it possible as of now?
Regards, Emiliyan
For now it's not possible. It's planned big rewriting of MatTable, so of course it will be implemented.
Thanks @SamProf
@SamProf, actually, I think it is possible now... I found it the hard waw by trying to create a table component as it essential to what I am doing. The same way we render any other column, we can render a button who with a function passes Id or else back. Example below.
<td>@context.Id</td>
<td>@context.Name</td>
<td>@context.MaterialType</td>
<td><button type="button" class="btn btn-warning btn-sm"
@onclick="( () => EditById(context.Id))">Edit</button></td>