diff --git a/apps/spreadsheeteditor/main/app/controller/PivotTable.js b/apps/spreadsheeteditor/main/app/controller/PivotTable.js index b8c29c3c2..47f16bf63 100644 --- a/apps/spreadsheeteditor/main/app/controller/PivotTable.js +++ b/apps/spreadsheeteditor/main/app/controller/PivotTable.js @@ -181,24 +181,10 @@ define([ onPivotGrandTotals: function(type){ if (this.api) { - switch (type){ - case 0: - // this._originalProps.asc_setColGrandTotals(false); - // this._originalProps.asc_setRowGrandTotals(false); - break; - case 1: - // this._originalProps.asc_setColGrandTotals(true); - // this._originalProps.asc_setRowGrandTotals(true); - break; - case 2: - // this._originalProps.asc_setColGrandTotals(false); - // this._originalProps.asc_setRowGrandTotals(true); - break; - case 3: - // this._originalProps.asc_setColGrandTotals(true); - // this._originalProps.asc_setRowGrandTotals(false); - break; - } + var props = this._originalProps.asc_clone(); + props.asc_setColGrandTotals(type == 1 || type == 3); + props.asc_setRowGrandTotals(type == 1 || type == 2); + this._originalProps.asc_set(this.api, props); } Common.NotificationCenter.trigger('edit:complete', this); }, diff --git a/apps/spreadsheeteditor/main/app/view/PivotSettings.js b/apps/spreadsheeteditor/main/app/view/PivotSettings.js index 8c417b881..8b8c29b96 100644 --- a/apps/spreadsheeteditor/main/app/view/PivotSettings.js +++ b/apps/spreadsheeteditor/main/app/view/PivotSettings.js @@ -191,6 +191,7 @@ define([ api: me.api, handler: function(result, value) { if (result == 'ok' && me.api && value) { + me._originalProps.asc_set(me.api, value); } Common.NotificationCenter.trigger('edit:complete', me); diff --git a/apps/spreadsheeteditor/main/app/view/PivotSettingsAdvanced.js b/apps/spreadsheeteditor/main/app/view/PivotSettingsAdvanced.js index 745cf5dcd..d6b572cdb 100644 --- a/apps/spreadsheeteditor/main/app/view/PivotSettingsAdvanced.js +++ b/apps/spreadsheeteditor/main/app/view/PivotSettingsAdvanced.js @@ -216,7 +216,11 @@ define([ 'text!spreadsheeteditor/main/app/template/PivotSettingsAdvanced.temp }, getSettings: function () { - return {}; + var props = this.props.asc_clone(); + props.asc_setColGrandTotals(this.chCols.getValue() == 'checked'); + props.asc_setRowGrandTotals(this.chRows.getValue() == 'checked'); + + return props; }, onDlgBtnClick: function(event) {