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

onSelect & row index

Open stephanebarbey opened this issue 9 years ago • 4 comments

I have a use case where I need to duplicate the selected rows in a table. So far so good, I can easily get the row selection.

My problem is that I should duplicate them in the order in which they appear in the table, which could be sorted, i.e. the order of the row keys does not match the order in which the rows appear in table.

Would it be possible to have a fourth parameter to the onSelect callback (row, isSelected, e, rowIndex), or, alternatively, is there a callback that yields me the index of a given row (key)? (or should I directly look in state.data?)

Thanks.

stephanebarbey avatar Jul 24 '17 10:07 stephanebarbey

@stephanebarbey, I think pass the rowIndex as fourth argument is possible in next version, thanks

AllenFang avatar Jul 25 '17 12:07 AllenFang

that would be great! Thanks.

stephanebarbey avatar Jul 25 '17 12:07 stephanebarbey

@stephanebarbey, this feature was implemented on v3.5.0, now you can get the rowIndex on onSelect's fourth argument.

AllenFang avatar Jul 29 '17 07:07 AllenFang

yes we can get the rowIndex, it's helpful, thanks for that @AllenFang , but the doc is not update

DANIELADIKO avatar Dec 27 '18 17:12 DANIELADIKO