Skip to content

Commit

Permalink
Merge pull request #596 from msenevir/fix-draggable-columns
Browse files Browse the repository at this point in the history
[Draggable Column] Error when dragging column; "removeObject is not a function"
  • Loading branch information
alexander-alvarez authored Jan 3, 2019
2 parents c94bb8c + c2966f4 commit d4673d8
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions addon/mixins/draggable-column.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,16 @@ export default Mixin.create({
let table = this.get('table');
let columns = this.get('dragColumnGroup');

let _columns = columns.toArray();
let targetColumnIdx = _columns.indexOf(targetColumn);
let targetColumnIdx = columns.indexOf(targetColumn);

e.dataTransfer.dropEffect = 'move';
e.preventDefault();
e.stopPropagation();

table.propertyWillChange('columns');

_columns.removeObject(sourceColumn);
_columns.insertAt(targetColumnIdx, sourceColumn);
columns.setObjects(_columns);
columns.removeObject(sourceColumn);
columns.insertAt(targetColumnIdx, sourceColumn);

table.propertyDidChange('columns');

Expand Down

0 comments on commit d4673d8

Please sign in to comment.