Commit 94a05aa20c19c76d1dcd5ca1c9700b7312edb6f8

Authored by Elena.Budnik
1 parent 2e8be1ae

update object in stat

Showing 1 changed file with 11 additions and 7 deletions   Show diff stats
js/app/views/StatisticsUI.js
@@ -57,19 +57,22 @@ Ext.define('amdaUI.StatisticsUI', { @@ -57,19 +57,22 @@ Ext.define('amdaUI.StatisticsUI', {
57 var formValues = basicForm.getValues(); 57 var formValues = basicForm.getValues();
58 // this.object.set('name',formValues.name); 58 // this.object.set('name',formValues.name);
59 // this.object.set('description',formValues.description); 59 // this.object.set('description',formValues.description);
60 - 60 +
61 var recs = this.paramGrid.getStore().getNewRecords(); 61 var recs = this.paramGrid.getStore().getNewRecords();
62 var paramArr = new Array(); 62 var paramArr = new Array();
63 - Ext.Array.each(recs, function(rec, index,allItems){ 63 +
  64 + Ext.Array.each(recs, function(rec, index,allItems)
  65 + {
64 var obj = new Object(); 66 var obj = new Object();
65 obj.param = rec.get('name'); 67 obj.param = rec.get('name');
66 obj.function = rec.get('function'); 68 obj.function = rec.get('function');
67 - paramArr.push(obj); 69 + paramArr.push(obj);
68 }); 70 });
  71 +
69 this.object.set('parameter', paramArr); 72 this.object.set('parameter', paramArr);
70 73
71 var timeSource = this.timeSelector.getActiveTimeSource(); 74 var timeSource = this.timeSelector.getActiveTimeSource();
72 - 75 +
73 if (timeSource === amdaModel.AmdaTimeObject.inputTimeSrc[0] // timeSource 'TimeTable' 76 if (timeSource === amdaModel.AmdaTimeObject.inputTimeSrc[0] // timeSource 'TimeTable'
74 && this.timeSelector.TTGrid.getStore().count() == 0) { 77 && this.timeSelector.TTGrid.getStore().count() == 0) {
75 myDesktopApp.warningMsg('You\'ve chosen Time Selection `by TimeTable` but no timeTable was added!' 78 myDesktopApp.warningMsg('You\'ve chosen Time Selection `by TimeTable` but no timeTable was added!'
@@ -77,7 +80,8 @@ Ext.define('amdaUI.StatisticsUI', { @@ -77,7 +80,8 @@ Ext.define('amdaUI.StatisticsUI', {
77 return false; 80 return false;
78 } 81 }
79 82
80 - // basicForm.updateRecord(this.object); 83 + basicForm.updateRecord(this.object);
  84 +
81 this.object.set('timesrc', timeSource); 85 this.object.set('timesrc', timeSource);
82 // set valid intervals into TimeTable object 86 // set valid intervals into TimeTable object
83 if (timeSource === amdaModel.AmdaTimeObject.inputTimeSrc[0]) 87 if (timeSource === amdaModel.AmdaTimeObject.inputTimeSrc[0])
@@ -297,8 +301,8 @@ Ext.define('amdaUI.StatisticsUI', { @@ -297,8 +301,8 @@ Ext.define('amdaUI.StatisticsUI', {
297 // update object with user's values 301 // update object with user's values
298 // if the return is true (object had been updated) 302 // if the return is true (object had been updated)
299 // if(this.updateObject()){ 303 // if(this.updateObject()){
300 - this.updateObject();  
301 - this.generateCatalog(); 304 + this.updateObject();
  305 + this.generateCatalog();
302 // } 306 // }
303 } 307 }
304 }, 308 },