react-bootstrap-table icon indicating copy to clipboard operation
react-bootstrap-table copied to clipboard

selectRow to work only on certain colums

Open czanbaka opened this issue 9 years ago • 3 comments

Hello,

I have a react-bootstrap-table and want to allow row selection only when the user clicks on the first column of the row. Is there anything I can specify in the selectRow property to allow this behavior?

const selectRow = { mode: 'radio', className: 'selectedPackage', clickToSelect: true, hideSelectColumn: true, };

The problem is that I have several editable columns in the table and once the user selects the row and goes to edit one of the cells, it keeps selecting and unselecting the row. The first column is not editable so I want to use only it for row selection.

Thanks! Cathy

czanbaka avatar May 25 '17 02:05 czanbaka

@czanbaka, sorry for lately reply, how about remove selectRow.clickToSelect`, it will not trigger selection when clicking on row so that user can only select/unselect row by clicking radio/checkbox?

is that ok for you? let me know your concern or consideration, thanks :)

AllenFang avatar May 28 '17 07:05 AllenFang

@AllenFang I was able to get the behavior I wanted by using the: onSelect: onSelectRow

and return true only from the desired column. Thanks! Cathy

czanbaka avatar May 31 '17 19:05 czanbaka

@czanbaka , how you did it? I'm trying the same, but without success. Thanks

arthursoas avatar May 16 '18 17:05 arthursoas