mirror of
https://github.com/gosticks/react-table.git
synced 2026-07-01 18:10:02 +00:00
added closeExpanded function to subComponent callback (#1121)
This commit is contained in:
committed by
Tanner Linsley
parent
188fc51336
commit
836f256031
@@ -47,7 +47,7 @@ export default class ComponentTest extends React.component {
|
||||
// const rtProps = {
|
||||
// data,
|
||||
// columns,
|
||||
// // ExpanderComponent: (props)=><ExpanderComponent {...props} />,
|
||||
// // ExpanderComponent: (props, closeExpanded)=><ExpanderComponent {...props, closeExpanded} />,
|
||||
// // SubComponent: (props)=><SubComponent {...props} />,
|
||||
// // multiSort: false,
|
||||
// }
|
||||
|
||||
@@ -665,7 +665,10 @@ export default class ReactTable extends Methods(Lifecycle(Component)) {
|
||||
{rowInfo.subRows &&
|
||||
isExpanded &&
|
||||
rowInfo.subRows.map((d, i) => makePageRow(d, i, rowInfo.nestingPath))}
|
||||
{SubComponent && !rowInfo.subRows && isExpanded && SubComponent(rowInfo)}
|
||||
{SubComponent && !rowInfo.subRows && isExpanded && SubComponent(rowInfo, () => {
|
||||
let newExpanded = _.clone(expanded)
|
||||
newExpanded = _.set(newExpanded, cellInfo.nestingPath, false)
|
||||
})}
|
||||
</TrGroupComponent>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user