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:
Don Pflaster
2018-10-04 14:36:46 -06:00
committed by Tanner Linsley
parent c79806090a
commit ac8b497671
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -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
View File
@@ -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'
)}