Skip to content

Commit db22bb9

Browse files
committed
fix #1015
1 parent d7e1f1d commit db22bb9

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

docs/row-expand.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,13 @@ Specify the content of expand row, `react-bootstrap-table2` will pass a row obje
2626

2727
#### values
2828
* **row**
29+
* **rowIndex**
2930

3031
#### examples
3132

3233
```js
3334
const expandRow = {
34-
renderer: row => (
35+
renderer: (row, rowIndex) => (
3536
<div>
3637
<p>{ `This Expand row is belong to rowKey ${row.id}` }</p>
3738
<p>You can render anything here, also you can add additional data on every row object</p>

packages/react-bootstrap-table2-example/examples/row-expand/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ const columns = [{
1818
}];
1919

2020
const expandRow = {
21-
renderer: row => (
21+
renderer: (row, rowIndex) => (
2222
<div>
23-
<p>{ `This Expand row is belong to rowKey ${row.id}` }</p>
23+
<p>{ `This Expand row is belong to rowKey ${row.id} and index: ${rowIndex}` }</p>
2424
<p>You can render anything here, also you can add additional data on every row object</p>
2525
<p>expandRow.renderer callback will pass the origin row object to you</p>
2626
</div>

packages/react-bootstrap-table2/src/row-expand/row-consumer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default (Component) => {
3434
expanded={ expanded }
3535
onClosed={ () => expandRow.onClosed(key) }
3636
>
37-
{ expandRow.renderer(props.row) }
37+
{ expandRow.renderer(props.row, props.rowIndex) }
3838
</ExpandRow> : null
3939
];
4040
};

0 commit comments

Comments
 (0)