mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2025-10-16 11:55:39 +00:00
fix #1015
This commit is contained in:
parent
d7e1f1dfd0
commit
db22bb9adb
@ -26,12 +26,13 @@ Specify the content of expand row, `react-bootstrap-table2` will pass a row obje
|
|||||||
|
|
||||||
#### values
|
#### values
|
||||||
* **row**
|
* **row**
|
||||||
|
* **rowIndex**
|
||||||
|
|
||||||
#### examples
|
#### examples
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const expandRow = {
|
const expandRow = {
|
||||||
renderer: row => (
|
renderer: (row, rowIndex) => (
|
||||||
<div>
|
<div>
|
||||||
<p>{ `This Expand row is belong to rowKey ${row.id}` }</p>
|
<p>{ `This Expand row is belong to rowKey ${row.id}` }</p>
|
||||||
<p>You can render anything here, also you can add additional data on every row object</p>
|
<p>You can render anything here, also you can add additional data on every row object</p>
|
||||||
|
|||||||
@ -18,9 +18,9 @@ const columns = [{
|
|||||||
}];
|
}];
|
||||||
|
|
||||||
const expandRow = {
|
const expandRow = {
|
||||||
renderer: row => (
|
renderer: (row, rowIndex) => (
|
||||||
<div>
|
<div>
|
||||||
<p>{ `This Expand row is belong to rowKey ${row.id}` }</p>
|
<p>{ `This Expand row is belong to rowKey ${row.id} and index: ${rowIndex}` }</p>
|
||||||
<p>You can render anything here, also you can add additional data on every row object</p>
|
<p>You can render anything here, also you can add additional data on every row object</p>
|
||||||
<p>expandRow.renderer callback will pass the origin row object to you</p>
|
<p>expandRow.renderer callback will pass the origin row object to you</p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -34,7 +34,7 @@ export default (Component) => {
|
|||||||
expanded={ expanded }
|
expanded={ expanded }
|
||||||
onClosed={ () => expandRow.onClosed(key) }
|
onClosed={ () => expandRow.onClosed(key) }
|
||||||
>
|
>
|
||||||
{ expandRow.renderer(props.row) }
|
{ expandRow.renderer(props.row, props.rowIndex) }
|
||||||
</ExpandRow> : null
|
</ExpandRow> : null
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user