Skip to content

Commit b088a37

Browse files
Adding isReorderable column property, to be able to turn off reordering for certain columns.
1 parent 44b2d25 commit b088a37

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/FixedDataTableCellGroup.react.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ var FixedDataTableCellGroupImpl = React.createClass({
117117
this.props.onColumnResize;
118118
var onColumnResize = cellIsResizable ? this.props.onColumnResize : null;
119119

120-
var cellIsReorderable = this.props.onColumnReorder && rowIndex === -1 && columnGroupWidth !== columnProps.width;
120+
var cellIsReorderable = columnProps.isReorderable && this.props.onColumnReorder && rowIndex === -1 && columnGroupWidth !== columnProps.width;
121121
var onColumnReorder = cellIsReorderable ? this.props.onColumnReorder : null;
122122

123123
var className = columnProps.cellClassName;

src/FixedDataTableColumn.react.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,15 @@ var FixedDataTableColumn = React.createClass({
156156
*/
157157
isResizable: PropTypes.bool,
158158

159+
/**
160+
* Whether the column can be dragged to reorder.
161+
*
162+
* This property only provides the UI for the column reordering. If this
163+
* is set to true, you will need to set the onColumnReorderEndCallback table
164+
* property and render your columns appropriately.
165+
*/
166+
isReorderable: PropTypes.bool,
167+
159168
/**
160169
* Whether cells in this column can be removed from document when outside
161170
* of viewport as a result of horizontal scrolling.

0 commit comments

Comments
 (0)