material-table icon indicating copy to clipboard operation
material-table copied to clipboard

Add one row (single) selection mode

Open angelelizalde21 opened this issue 7 years ago • 6 comments

hi

I think it would be great to have the option to select both one and multimples rows

I would appreciate very much if I added this feature

angelelizalde21 avatar Mar 08 '19 17:03 angelelizalde21

Hi @angelelizalde21 ,

It already have selection feature.

https://mbrn.github.io/material-table/#/docz-examples-05-example-selection

mbrn avatar Mar 08 '19 20:03 mbrn

if I'm using the selection option, but would I like to have the option to select one row at a time, or some way to just select one?

angelelizalde21 avatar Mar 08 '19 20:03 angelelizalde21

You can do it with onRowClick event. It will give you clicked rowData. So you can send a rowStyle to table according to selected row.

If you can not do it let me know. I will add a example about it.

mbrn avatar Mar 08 '19 21:03 mbrn

I already made the code. in fact it works thanks a lot, I hope in a while you could add selection modes (sinlge or mutiple). for now it works, thanks for the excellent help greetings.

angelelizalde21 avatar Mar 08 '19 23:03 angelelizalde21

Hey @mbrn I am confused on how to let the user only select only one row only. Since there is only option for checkboxes and not radio buttons. Can you add an example over here please ?

gaurav-agarwal27 avatar Aug 04 '20 11:08 gaurav-agarwal27

You can do it with onRowClick event. It will give you clicked rowData. So you can send a rowStyle to table according to selected row.

If you can not do it let me know. I will add a example about it.

Hello. It's a pitty but my skills of TypeScript and React is low. Would you please give me example of this code?

imhotrez avatar Feb 06 '22 19:02 imhotrez