Skip to content

Conversation

amanmahajan7
Copy link
Collaborator

@amanmahajan7 amanmahajan7 commented Oct 21, 2018

image

@malonecj malonecj changed the base branch from next to master October 22, 2018 12:07
@malonecj malonecj changed the base branch from master to next October 22, 2018 12:07
@malonecj
Copy link
Contributor

Hey @amanmahajan7 Since this is a minor change we should have master as the base branch rather than next

@amanmahajan7
Copy link
Collaborator Author

@malonecj master does not have the latest code, we should catchup with next and I can create a new PR with master as the base branch

@amanmahajan7 amanmahajan7 changed the base branch from next to master October 24, 2018 14:23
Add HeaderRowType constant
Use column name instead of key for group name
Copy link
Collaborator Author

@amanmahajan7 amanmahajan7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are tow pending issues

  1. Drag preview is incorrect and I am not sure why. It works fine in the immutable example

image

  1. Group row is incorrectly selected. Need to decide how to handle it

image

let key = keys[i];
let isExpanded = this.isRowExpanded(columnName, key);
let rowGroupHeader = {name: key, __metaData: {isGroup: true, treeDepth: columnIndex, isExpanded: isExpanded, columnGroupName: columnName}};
let rowGroupHeader = {name: key, __metaData: {isGroup: true, treeDepth: columnIndex, isExpanded: isExpanded, columnGroupName: columnName, columnGroupDisplayName}};
Copy link
Collaborator Author

@amanmahajan7 amanmahajan7 Oct 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added this to show column.name instead of column.key in the group row

};
}

setScrollLeft(scrollLeft) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer required as HeaderCell content is wrapped inside a DraggableHeaderCell

renderBaseRow: PropTypes.func.isRequired
};

setScrollLeft = (scrollBy) => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not required as we introduced renderBaseRow

import Row from './Row';
import cellMetaDataShape from 'common/prop-shapes/CellActionShape';
import * as rowUtils from './RowUtils';
import RowGroup, { DefaultRowGroupRenderer } from './RowGroup';
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DefaultRowGroupRenderer does not exist


getSelectedRowColumns = (rowIdx) => {
const row = this.getRowByRef(rowIdx);
return row && row.props ? row.props.columns : this.props.columns;
Copy link
Collaborator Author

@amanmahajan7 amanmahajan7 Oct 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was causing an error for grouped rows

</div>
);

if (rowType === HeaderRowType.HEADER && column.draggable) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrapping HeaderCell content. This has a few benefits

  1. setScrollLeft is not required in DraggableHeaderCell. So this works with frozen columns, it was broken before
  2. It works with any header cell renderer

In the future I would like to clean up header rendering logic so we can easily compose them

DraggableHeaderCell(SortableHeaderCell(SimpleHeaderCell or column.headerRenderer))

if (isDragging) {
return null;
}
return connectDragSource(<div ref={node => this.node = node} style={{cursor: 'move'}}>{this.props.renderHeaderCell(this.props)}</div>);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renderHeaderCell is not passed as a prop

@amanmahajan7 amanmahajan7 removed the WIP label Oct 24, 2018
Copy link
Contributor

@malonecj malonecj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me

@malonecj malonecj merged commit fd85bb0 into master Oct 29, 2018
@amanmahajan7 amanmahajan7 deleted the am-cm-fix-grouping branch October 29, 2018 13:52
@amanmahajan7 amanmahajan7 mentioned this pull request Oct 30, 2018
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants