diff --git a/js/app/views/ParamArgumentsUI.js b/js/app/views/ParamArgumentsUI.js index 57fe8a4..f2aa57a 100644 --- a/js/app/views/ParamArgumentsUI.js +++ b/js/app/views/ParamArgumentsUI.js @@ -276,29 +276,31 @@ Ext.define('amdaUI.ParamArgumentsUI', { } ]; - var sumRangeFieldSet = Ext.create('Ext.form.FieldSet', { - title: relatedTable.variable ? title + " - Sum. in range" : "Sum. in range", + var sumRangeFieldSet = Ext.create('Ext.form.FieldSet', { + title: relatedTable.variable ? title + " - Sum. in range" : "Sum. in range", collapsed: true, - checkboxName: 'range_checkbox_'+relatedDim, - checkboxToggle: true, - name: 'range_fieldset_'+relatedDim, - layout: { - type: 'vbox', - pack: 'start', - align: 'stretch' + checkboxName: 'range_checkbox_'+relatedDim, + checkboxToggle: true, + name: 'range_fieldset_'+relatedDim, + layout: { + type: 'vbox', + pack: 'start', + align: 'stretch' }, items: rangeItems, listeners: { expand: function(fieldset, eOpts) { if (relatedTable.variable) { - myDesktopApp.infoMsg('SumInRange for variable EnergyTable is not implemented yet'); - fieldset.collapse(); + //TODO define min/max auto + var minValue = 10; + var maxValue = 1000; } else { var minValue = parseInt(relatedTable.channels[0].min); var maxValue = parseInt(relatedTable.channels[relatedTable.channels.length - 1].max); - fieldset.items.items[ + (minValue > maxValue)].setValue(minValue); - fieldset.items.items[ + (minValue < maxValue)].setValue(maxValue); + } + fieldset.items.items[ + (minValue > maxValue)].setValue(minValue); + fieldset.items.items[ + (minValue < maxValue)].setValue(maxValue); // if (indexesCombo.getValue() == "*") { // Ext.Object.each(relatedTable.channels, function (index, channel) { // //ToDo @@ -309,33 +311,30 @@ Ext.define('amdaUI.ParamArgumentsUI', { // // //ToDo // } - indexesCombo.setDisabled(true); + indexesCombo.setDisabled(true); - this.paramRequestObject.set(relatedDim+'-is-range', true); - if (this.onChange != null) - this.onChange(uiScope, relatedDim, true, false, false); - if (this.onModifyHeight) - this.onModifyHeight(this.pluginOwner); - } + this.paramRequestObject.set(relatedDim+'-is-range', true); + if (this.onChange != null) + this.onChange(uiScope, relatedDim, true, false, false); + if (this.onModifyHeight) + this.onModifyHeight(this.pluginOwner); }, collapse: function(fieldset, eOpts) { - indexesCombo.setDisabled(false); - - this.paramRequestObject.set(relatedDim+'-is-range', false); - if (this.onChange != null) - this.onChange(uiScope, relatedDim, false, true, false); - if (this.onModifyHeight) - this.onModifyHeight(this.pluginOwner); - }, - scope: this + indexesCombo.setDisabled(false); + + this.paramRequestObject.set(relatedDim+'-is-range', false); + if (this.onChange != null) + this.onChange(uiScope, relatedDim, false, true, false); + if (this.onModifyHeight) + this.onModifyHeight(this.pluginOwner); + }, + scope: this } - }); - + }); this.add(sumRangeFieldSet); } - return indexesCombo; - }, + }, buildTemplateArguments: function(arguments, uiScope) { var me = this; -- libgit2 0.21.2