Skip to content

Commit

Permalink
[SSE] Fix moving fields in pivot table
Browse files Browse the repository at this point in the history
  • Loading branch information
JuliaRadzhabova committed Sep 25, 2024
1 parent 2de53c3 commit cf1764f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions apps/spreadsheeteditor/main/app/view/PivotSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -891,19 +891,20 @@ define([
onMoveTo: function(type, pivotindex, to) {
if (this.api && !this._locked && this._state.field){
var pivotIndex = _.isNumber(pivotindex) ? pivotindex : this._state.field.record.get('pivotIndex'),
index = _.isNumber(to) ? to : ((this._state.field.type==2) ? this._state.field.record.get('index') : undefined);
index = _.isNumber(to) ? to : undefined,
dataIndex = (this._state.field.type==2) ? this._state.field.record.get('index') : undefined;
switch (type) {
case 0:
this._originalProps.asc_moveToColField(this.api, pivotIndex, index);
this._originalProps.asc_moveToColField(this.api, pivotIndex, dataIndex, index);
break;
case 1:
this._originalProps.asc_moveToRowField(this.api, pivotIndex, index);
this._originalProps.asc_moveToRowField(this.api, pivotIndex, dataIndex, index);
break;
case 2:
this._originalProps.asc_moveToDataField(this.api, pivotIndex, index);
this._originalProps.asc_moveToDataField(this.api, pivotIndex, dataIndex, index);
break;
case 3:
this._originalProps.asc_moveToPageField(this.api, pivotIndex, index);
this._originalProps.asc_moveToPageField(this.api, pivotIndex, dataIndex, index);
break;
}
Common.NotificationCenter.trigger('edit:complete', this);
Expand Down

0 comments on commit cf1764f

Please sign in to comment.