Skip to content

Commit

Permalink
Fixed #564
Browse files Browse the repository at this point in the history
  • Loading branch information
Çağatay Çivici authored and Çağatay Çivici committed Sep 11, 2018
1 parent eaec4df commit dbf5fb6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/components/datatable/DataTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ export class DataTable extends Component {
onColumnResizeStart(event) {
let containerLeft = DomHandler.getOffset(this.container).left;
this.resizeColumn = event.columnEl;
this.resizeColumnProps = event.columnProps;
this.columnResizing = true;
this.lastResizerHelperX = (event.originalEvent.pageX - containerLeft + this.container.scrollLeft);

Expand Down Expand Up @@ -483,13 +484,15 @@ export class DataTable extends Component {
if(this.props.onColumnResizeEnd) {
this.props.onColumnResizeEnd({
element: this.resizeColumn,
column: this.resizeColumnProps,
delta: delta
});
}
}

this.resizerHelper.style.display = 'none';
this.resizeColumn = null;
this.resizeColumnProps = null;
DomHandler.removeClass(this.container, 'p-unselectable-text');

this.unbindColumnResizeEvents();
Expand Down
3 changes: 2 additions & 1 deletion src/components/datatable/HeaderCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ export class HeaderCell extends Component {
if(this.props.resizableColumns && this.props.onColumnResizeStart) {
this.props.onColumnResizeStart({
originalEvent: event,
columnEl: event.target.parentElement
columnEl: event.target.parentElement,
columnProps: this.props
});
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/showcase/datatable/DataTableDemo.js
Original file line number Diff line number Diff line change
Expand Up @@ -1940,7 +1940,8 @@ export class DataTableLazyDemo extends Component {
</tr>
<tr>
<td>onColumnResizeEnd</td>
<td>event.element: DOM element of the resized column.<br />
<td>event.element: DOM element of the resized column.
event.column: Properties of the resized column.<br />
event.delta: Change in column width</td>
<td>Callback to invoke when a column is resized.</td>
</tr>
Expand Down

0 comments on commit dbf5fb6

Please sign in to comment.