From 5f6c29d952832366d7e7ca55162312aed0574241 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 19 Jul 2017 14:29:21 +0300 Subject: [PATCH] [SSE] Apply value field settings. --- apps/spreadsheeteditor/main/app/view/PivotSettings.js | 5 +++-- .../main/app/view/ValueFieldSettingsDialog.js | 10 +++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/PivotSettings.js b/apps/spreadsheeteditor/main/app/view/PivotSettings.js index 9b914de16..8c417b881 100644 --- a/apps/spreadsheeteditor/main/app/view/PivotSettings.js +++ b/apps/spreadsheeteditor/main/app/view/PivotSettings.js @@ -584,15 +584,16 @@ define([ var win; if (me.api && !this._locked && me._state.field){ if (me._state.field.type == 2) { // value field + var field = me._originalProps.asc_getDataFields()[me._state.field.record.get('index')]; (new SSE.Views.ValueFieldSettingsDialog( { props: me._originalProps, - fieldIndex: me._state.field.record.get('index'), + field: field, names: me._state.names, api: me.api, handler: function(result, value) { if (result == 'ok' && me.api && value) { - // me.api.asc_changeFormatTableInfo(me._state.TableName, Asc.c_oAscChangeTableStyleInfo.advancedSettings, value); + field.asc_set(me.api, me._originalProps, value); } Common.NotificationCenter.trigger('edit:complete', me); diff --git a/apps/spreadsheeteditor/main/app/view/ValueFieldSettingsDialog.js b/apps/spreadsheeteditor/main/app/view/ValueFieldSettingsDialog.js index a0fcbf705..e615ae673 100644 --- a/apps/spreadsheeteditor/main/app/view/ValueFieldSettingsDialog.js +++ b/apps/spreadsheeteditor/main/app/view/ValueFieldSettingsDialog.js @@ -119,7 +119,7 @@ define([ this.api = options.api; this.handler = options.handler; this.props = options.props; - this.fieldIndex = options.fieldIndex || 0; + this.field = options.field || 0; this.names = options.names || []; Common.Views.AdvancedSettingsWindow.prototype.initialize.call(this, this.options); @@ -213,7 +213,7 @@ define([ _setDefaults: function (props) { if (props) { - var field = props.asc_getDataFields()[this.fieldIndex], + var field = this.field, cache_names = props.asc_getCacheFields(), show_as = field.asc_getShowDataAs(); @@ -239,7 +239,11 @@ define([ }, getSettings: function () { - return {}; + var field = this.field.asc_clone(); + field.asc_setName(this.inputCustomName.getValue()); + field.asc_setSubtotal(this.cmbSummarize.getValue()); + + return field; }, onDlgBtnClick: function(event) {