MatBlazor icon indicating copy to clipboard operation
MatBlazor copied to clipboard

MatTable - A way to return the Selected @context.Id?

Open etcircle opened this issue 7 years ago • 3 comments

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

etcircle avatar Aug 18 '19 15:08 etcircle

For now it's not possible. It's planned big rewriting of MatTable, so of course it will be implemented.

SamProf avatar Aug 20 '19 16:08 SamProf

Thanks @SamProf

etcircle avatar Aug 21 '19 14:08 etcircle

@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>

etcircle avatar Aug 21 '19 20:08 etcircle