File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
react-bootstrap-table2-example/examples/rows
react-bootstrap-table2/src Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ const columns = [{
2020} ] ;
2121
2222const rowEvents = {
23- onClick : ( e , rowIndex ) => {
23+ onClick : ( e , row , rowIndex ) => {
2424 alert ( `clicked on row with index: ${ rowIndex } ` ) ;
2525 }
2626} ;
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ class Row extends Component {
3636
3737 const clickFn = ( ) => {
3838 if ( attrs . onClick ) {
39- attrs . onClick ( e ) ;
39+ attrs . onClick ( e , row , rowIndex ) ;
4040 }
4141 if ( selectable ) {
4242 const key = _ . get ( row , keyField ) ;
@@ -59,11 +59,12 @@ class Row extends Component {
5959
6060 handleSimpleRowClick ( e ) {
6161 const {
62+ row,
6263 rowIndex,
6364 attrs
6465 } = this . props ;
6566
66- attrs . onClick ( e , rowIndex ) ;
67+ attrs . onClick ( e , row , rowIndex ) ;
6768 }
6869
6970 render ( ) {
@@ -99,7 +100,7 @@ class Row extends Component {
99100 const trAttrs = { ...attrs } ;
100101 if ( clickToSelect ) {
101102 trAttrs . onClick = this . handleRowClick ;
102- } else {
103+ } else if ( attrs . onClick ) {
103104 trAttrs . onClick = this . handleSimpleRowClick ;
104105 }
105106
You can’t perform that action at this time.
0 commit comments