mirror of
https://github.com/gosticks/react-table.git
synced 2026-08-12 13:00:26 +00:00
Tree uses accessor or ID and always shows pivot cells (#1011)
* Also check ID field when finding pivot col in treeTableHOC * Pass the ID if you've got one on treeTableHOC * An expandable cell should never be hidden
This commit is contained in:
committed by
Tanner Linsley
parent
c79806090a
commit
ac8b497671
@@ -49,8 +49,9 @@ export default Component => {
|
||||
const extra = {
|
||||
columns: columns.map(col => {
|
||||
let column = col
|
||||
if (rest.pivotBy && rest.pivotBy.includes(col.accessor)) {
|
||||
if (rest.pivotBy && (rest.pivotBy.includes(col.accessor) || rest.pivotBy.includes(col.id))) {
|
||||
column = {
|
||||
id: col.id,
|
||||
accessor: col.accessor,
|
||||
width: `${treeTableIndent}px`,
|
||||
show: false,
|
||||
|
||||
+1
-1
@@ -643,7 +643,7 @@ export default class ReactTable extends Methods(Lifecycle(Component)) {
|
||||
key={`${i2}-${column.id}`}
|
||||
className={classnames(
|
||||
classes,
|
||||
!show && 'hidden',
|
||||
!cellInfo.expandable && !show && 'hidden',
|
||||
cellInfo.expandable && 'rt-expandable',
|
||||
(isBranch || isPreview) && 'rt-pivot'
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user