From 0184f26ad3e866d8769bfcf0a7164930f43f879d Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 8 Aug 2017 11:49:57 +0300 Subject: [PATCH] [SSE] Added asc_getSubtotals for field settings. --- .../main/app/view/FieldSettingsDialog.js | 44 ++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/apps/spreadsheeteditor/main/app/view/FieldSettingsDialog.js b/apps/spreadsheeteditor/main/app/view/FieldSettingsDialog.js index 2c9d9478f..95783eedb 100644 --- a/apps/spreadsheeteditor/main/app/view/FieldSettingsDialog.js +++ b/apps/spreadsheeteditor/main/app/view/FieldSettingsDialog.js @@ -226,13 +226,55 @@ define([ 'text!spreadsheeteditor/main/app/template/FieldSettingsDialog.templa _setDefaults: function (props) { if (props) { - var cache_names = props.asc_getCacheFields(), + var me = this, + cache_names = props.asc_getCacheFields(), field = props.asc_getPivotFields()[this.fieldIndex]; this.lblSourceName.html(Common.Utils.String.htmlEncode(cache_names[this.fieldIndex].asc_getName())); this.inputCustomName.setValue(Common.Utils.String.htmlEncode((field || cache_names[this.fieldIndex]).asc_getName())); (field.asc_getSubtotalTop()) ? this.radioTop.setValue(true) : this.radioBottom.setValue(true); + + var arr = field.asc_getSubtotals(); + if (arr) { + _.each(arr, function(item) { + switch(item) { + case Asc.c_oAscItemType.Sum: + me.chSum.setValue(true); + break; + case Asc.c_oAscItemType.Count: + me.chCount.setValue(true); + break; + case Asc.c_oAscItemType.Avg: + me.chAve.setValue(true); + break; + case Asc.c_oAscItemType.Max: + me.chMax.setValue(true); + break; + case Asc.c_oAscItemType.Min: + me.chMin.setValue(true); + break; + case Asc.c_oAscItemType.Product: + me.chProduct.setValue(true); + break; + case Asc.c_oAscItemType.CountA: + me.chNum.setValue(true); + break; + case Asc.c_oAscItemType.StdDev: + me.chDev.setValue(true); + break; + case Asc.c_oAscItemType.StdDevP: + me.chDevp.setValue(true); + break; + case Asc.c_oAscItemType.Var: + me.chVar.setValue(true); + break; + case Asc.c_oAscItemType.VarP: + me.chVarp.setValue(true); + break; + } + }); + } } },