Commit 9913b97266c4fdadb37e8c8e8ed44c6ed30e8d8e
1 parent
cc663bbe
Exists in
master
and in
111 other branches
Update services results when loading epntap from tree for the first time
Showing
1 changed file
with
16 additions
and
11 deletions
Show diff stats
js/app/controllers/EpnTapModule.js
... | ... | @@ -43,15 +43,14 @@ Ext.define('amdaDesktop.EpnTapModule', { |
43 | 43 | this.acquireElements() |
44 | 44 | this.addListeners() |
45 | 45 | |
46 | - this.servicesStore.each(function (record) { | |
47 | - record.set('nb_results', -1) | |
48 | - }, this) | |
49 | - this.granulesStore.removeAll() | |
50 | - | |
51 | 46 | if (filter) { |
52 | 47 | this.targetNameCB.setRawValue(filter['targetName']) |
53 | 48 | this.productTypeCB.select(filter['productType']) |
54 | - this.getServices() | |
49 | + } else { | |
50 | + this.servicesStore.each(function (record) { | |
51 | + record.set('nb_results', -1) | |
52 | + }, this) | |
53 | + this.granulesStore.removeAll() | |
55 | 54 | } |
56 | 55 | }, |
57 | 56 | |
... | ... | @@ -71,6 +70,10 @@ Ext.define('amdaDesktop.EpnTapModule', { |
71 | 70 | }, |
72 | 71 | |
73 | 72 | addListeners: function () { |
73 | + this.servicesStore.on('load', function () { | |
74 | + this.getServices() | |
75 | + }, this) | |
76 | + | |
74 | 77 | this.servicesGrid.on('cellclick', function (grid, td, cellIndex, record) { |
75 | 78 | this.onServiceSelected(record) |
76 | 79 | }, this) |
... | ... | @@ -89,16 +92,18 @@ Ext.define('amdaDesktop.EpnTapModule', { |
89 | 92 | */ |
90 | 93 | getServices: function () { |
91 | 94 | /* global loadMask */ |
95 | + loadMask.show() | |
96 | + | |
97 | + const targetName = this.targetNameCB.rawValue | |
98 | + const productTypes = this.productTypeCB.value.join(';') | |
99 | + const timeMin = Ext.Date.format(this.timeSelector.getStartTime(), 'd/m/Y H:i:s') | |
100 | + const timeMax = Ext.Date.format(this.timeSelector.getStopTime(), 'd/m/Y H:i:s') | |
101 | + | |
92 | 102 | this.servicesStore.each(function (record) { |
93 | 103 | record.set('nb_results', -1) |
94 | 104 | }, this) |
95 | 105 | this.granulesStore.removeAll() |
96 | - const targetName = this.targetNameCB.rawValue | |
97 | - const productTypes = this.productTypeCB.value.join(';') | |
98 | - const timeMin = Ext.Date.format(this.timeSelector.getStartTime(), 'd/m/Y H:i:s') // start time | |
99 | - const timeMax = Ext.Date.format(this.timeSelector.getStopTime(), 'd/m/Y H:i:s') // stop time | |
100 | 106 | |
101 | - loadMask.show() | |
102 | 107 | this.servicesStore.each(function (record) { |
103 | 108 | const ss = this.servicesStore |
104 | 109 | Ext.Ajax.request({ | ... | ... |