[SSE] Pivot: refactoring value field settings
This commit is contained in:
parent
04524baac7
commit
6c80d89bd0
|
@ -49,7 +49,7 @@ define([
|
||||||
SSE.Views.ValueFieldSettingsDialog = Common.Views.AdvancedSettingsWindow.extend(_.extend({
|
SSE.Views.ValueFieldSettingsDialog = Common.Views.AdvancedSettingsWindow.extend(_.extend({
|
||||||
options: {
|
options: {
|
||||||
contentWidth: 284,
|
contentWidth: 284,
|
||||||
height: 340
|
height: 220
|
||||||
},
|
},
|
||||||
|
|
||||||
initialize : function(options) {
|
initialize : function(options) {
|
||||||
|
@ -74,41 +74,32 @@ define([
|
||||||
'<div id="value-field-settings-custom" style="width:264px;"></div>',
|
'<div id="value-field-settings-custom" style="width:264px;"></div>',
|
||||||
'</td>',
|
'</td>',
|
||||||
'</tr>',
|
'</tr>',
|
||||||
'<tr>',
|
|
||||||
'<td colspan="2" class="padding-small">',
|
|
||||||
'</td>',
|
|
||||||
'</tr>',
|
|
||||||
'<tr>',
|
'<tr>',
|
||||||
'<td colspan="2" class="padding-large">',
|
'<td colspan="2" class="padding-large">',
|
||||||
'<label class="header">', me.txtSummarize,'</label>',
|
'<label class="header">', me.txtSummarize,'</label>',
|
||||||
'<div id="value-field-settings-summarize" class="input-group-nr" style="width:264px;"></div>',
|
'<div id="value-field-settings-summarize" class="input-group-nr" style="width:264px;"></div>',
|
||||||
'</td>',
|
'</td>',
|
||||||
'</tr>',
|
'</tr>',
|
||||||
'<tr>',
|
// '<tr>',
|
||||||
'<td colspan="2" class="padding-small">',
|
// '<td colspan="2" class="padding-large">',
|
||||||
'</td>',
|
// '<label class="header">', me.txtShowAs,'</label>',
|
||||||
'</tr>',
|
// '<div id="value-field-settings-showas" class="input-group-nr" style="width:264px;"></div>',
|
||||||
'<tr>',
|
// '</td>',
|
||||||
'<td colspan="2" class="padding-large">',
|
// '</tr>',
|
||||||
'<label class="header">', me.txtShowAs,'</label>',
|
// '<tr class="format-code">',
|
||||||
'<div id="value-field-settings-showas" class="input-group-nr" style="width:264px;"></div>',
|
// '<td>',
|
||||||
'</td>',
|
// '<label class="header">', me.txtBaseField,'</label>',
|
||||||
'</tr>',
|
// '<div id="value-field-settings-field" class="input-group-nr" style="width:128px;"></div>',
|
||||||
'<tr class="format-code">',
|
// '</td>',
|
||||||
'<td>',
|
// '<td style="float: right;">',
|
||||||
'<label class="header">', me.txtBaseField,'</label>',
|
// '<label class="header">', me.txtBaseItem,'</label>',
|
||||||
'<div id="value-field-settings-field" class="input-group-nr" style="width:125px;"></div>',
|
// '<div id="value-field-settings-item" class="input-group-nr" style="width:128px;"></div>',
|
||||||
'</td>',
|
// '</td>',
|
||||||
'<td>',
|
// '</tr>',
|
||||||
'<label class="header">', me.txtBaseItem,'</label>',
|
|
||||||
'<div id="value-field-settings-item" class="input-group-nr" style="width:125px;"></div>',
|
|
||||||
'</td>',
|
|
||||||
'</tr>',
|
|
||||||
'</table>',
|
'</table>',
|
||||||
'</div></div>',
|
'</div></div>',
|
||||||
'</div>',
|
'</div>',
|
||||||
'</div>',
|
'</div>'
|
||||||
'<div class="separator horizontal"/>'
|
|
||||||
].join('')
|
].join('')
|
||||||
}, options);
|
}, options);
|
||||||
|
|
||||||
|
@ -135,7 +126,8 @@ define([
|
||||||
this.cmbSummarize = new Common.UI.ComboBox({
|
this.cmbSummarize = new Common.UI.ComboBox({
|
||||||
el: $('#value-field-settings-summarize'),
|
el: $('#value-field-settings-summarize'),
|
||||||
cls: 'input-group-nr',
|
cls: 'input-group-nr',
|
||||||
menuStyle: 'min-width: 264px;',
|
menuStyle: 'min-width: 264px;max-height:160px;',
|
||||||
|
scrollAlwaysVisible: true,
|
||||||
editable: false,
|
editable: false,
|
||||||
data: [
|
data: [
|
||||||
{ value: Asc.c_oAscDataConsolidateFunction.Sum, displayValue: this.txtSum },
|
{ value: Asc.c_oAscDataConsolidateFunction.Sum, displayValue: this.txtSum },
|
||||||
|
@ -154,10 +146,11 @@ define([
|
||||||
this.cmbSummarize.setValue(Asc.c_oAscDataConsolidateFunction.Sum);
|
this.cmbSummarize.setValue(Asc.c_oAscDataConsolidateFunction.Sum);
|
||||||
this.cmbSummarize.on('selected', _.bind(this.onSummarizeSelect, this));
|
this.cmbSummarize.on('selected', _.bind(this.onSummarizeSelect, this));
|
||||||
|
|
||||||
|
/*
|
||||||
this.cmbShowAs = new Common.UI.ComboBox({
|
this.cmbShowAs = new Common.UI.ComboBox({
|
||||||
el: $('#value-field-settings-showas'),
|
el: $('#value-field-settings-showas'),
|
||||||
cls: 'input-group-nr',
|
cls: 'input-group-nr',
|
||||||
menuStyle: 'min-width: 264px;',
|
menuStyle: 'min-width: 264px;max-height:160px;',
|
||||||
editable: false,
|
editable: false,
|
||||||
data: [
|
data: [
|
||||||
{ value: Asc.c_oAscShowDataAs.Normal, displayValue: this.txtNormal },
|
{ value: Asc.c_oAscShowDataAs.Normal, displayValue: this.txtNormal },
|
||||||
|
@ -177,7 +170,7 @@ define([
|
||||||
this.cmbBaseField = new Common.UI.ComboBox({
|
this.cmbBaseField = new Common.UI.ComboBox({
|
||||||
el: $('#value-field-settings-field'),
|
el: $('#value-field-settings-field'),
|
||||||
cls: 'input-group-nr',
|
cls: 'input-group-nr',
|
||||||
menuStyle: 'min-width: 264px;max-height:235px;',
|
menuStyle: 'min-width: 100%;max-height:160px;',
|
||||||
editable: false,
|
editable: false,
|
||||||
data: [],
|
data: [],
|
||||||
scrollAlwaysVisible: true
|
scrollAlwaysVisible: true
|
||||||
|
@ -187,12 +180,13 @@ define([
|
||||||
this.cmbBaseItem = new Common.UI.ComboBox({
|
this.cmbBaseItem = new Common.UI.ComboBox({
|
||||||
el: $('#value-field-settings-item'),
|
el: $('#value-field-settings-item'),
|
||||||
cls: 'input-group-nr',
|
cls: 'input-group-nr',
|
||||||
menuStyle: 'min-width: 264px;max-height:235px;',
|
menuStyle: 'min-width: 100%;max-height:160px;',
|
||||||
editable: false,
|
editable: false,
|
||||||
data: [],
|
data: [],
|
||||||
scrollAlwaysVisible: true
|
scrollAlwaysVisible: true
|
||||||
});
|
});
|
||||||
this.cmbBaseItem.on('selected', _.bind(this.onBaseItemSelect, this));
|
this.cmbBaseItem.on('selected', _.bind(this.onBaseItemSelect, this));
|
||||||
|
*/
|
||||||
|
|
||||||
this.lblSourceName = this.$window.find('#value-field-settings-source');
|
this.lblSourceName = this.$window.find('#value-field-settings-source');
|
||||||
|
|
||||||
|
@ -210,15 +204,15 @@ define([
|
||||||
_setDefaults: function (props) {
|
_setDefaults: function (props) {
|
||||||
if (props) {
|
if (props) {
|
||||||
var field = this.field,
|
var field = this.field,
|
||||||
cache_names = props.asc_getCacheFields(),
|
cache_names = props.asc_getCacheFields();
|
||||||
show_as = field.asc_getShowDataAs();
|
|
||||||
|
|
||||||
this.lblSourceName.html(Common.Utils.String.htmlEncode(cache_names[field.asc_getIndex()].asc_getName()));
|
this.lblSourceName.html(Common.Utils.String.htmlEncode(cache_names[field.asc_getIndex()].asc_getName()));
|
||||||
this.inputCustomName.setValue(Common.Utils.String.htmlEncode(field.asc_getName()));
|
this.inputCustomName.setValue(Common.Utils.String.htmlEncode(field.asc_getName()));
|
||||||
|
|
||||||
this.cmbSummarize.setValue(field.asc_getSubtotal());
|
this.cmbSummarize.setValue(field.asc_getSubtotal());
|
||||||
this.cmbShowAs.setValue(show_as);
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
var show_as = field.asc_getShowDataAs();
|
||||||
|
this.cmbShowAs.setValue(show_as);
|
||||||
var data = [];
|
var data = [];
|
||||||
this.names.forEach(function(item){
|
this.names.forEach(function(item){
|
||||||
data.push({value: item, displayValue: item});
|
data.push({value: item, displayValue: item});
|
||||||
|
@ -231,6 +225,7 @@ define([
|
||||||
// this.cmbBaseItem.setData(data);
|
// this.cmbBaseItem.setData(data);
|
||||||
this.cmbBaseItem.setDisabled(show_as != c_oAscShowDataAs.Difference && show_as != c_oAscShowDataAs.Percent &&
|
this.cmbBaseItem.setDisabled(show_as != c_oAscShowDataAs.Difference && show_as != c_oAscShowDataAs.Percent &&
|
||||||
show_as != c_oAscShowDataAs.PercentDiff);
|
show_as != c_oAscShowDataAs.PercentDiff);
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -262,6 +257,9 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onShowAsSelect: function(combo, record) {
|
onShowAsSelect: function(combo, record) {
|
||||||
|
// var show_as = record.value;
|
||||||
|
// this.cmbBaseField.setDisabled(show_as != c_oAscShowDataAs.Difference && show_as != c_oAscShowDataAs.Percent &&
|
||||||
|
// show_as != c_oAscShowDataAs.PercentDiff && show_as != c_oAscShowDataAs.RunTotal);
|
||||||
},
|
},
|
||||||
|
|
||||||
onBaseFieldSelect: function(combo, record) {
|
onBaseFieldSelect: function(combo, record) {
|
||||||
|
|
Loading…
Reference in a new issue