Commit 6c285fbf02d15a9cc1b21e82a09fcd9d69d0415e
1 parent
da39aa7e
Exists in
master
and in
112 other branches
Disable services grid when processing the query.
Showing
2 changed files
with
22 additions
and
10 deletions
Show diff stats
js/app/controllers/EpnTapModule.js
... | ... | @@ -212,6 +212,7 @@ Ext.define('amdaDesktop.EpnTapModule', { |
212 | 212 | // *** Buttons events *** |
213 | 213 | |
214 | 214 | onFirstPageBtnClicked: function() { |
215 | + this.wait(); | |
215 | 216 | this.currentPageLb.setText('1'); |
216 | 217 | |
217 | 218 | this.nextBtn.setDisabled(false); |
... | ... | @@ -227,6 +228,7 @@ Ext.define('amdaDesktop.EpnTapModule', { |
227 | 228 | }, |
228 | 229 | |
229 | 230 | onPreviousPageBtnClicked: function() { |
231 | + this.wait(); | |
230 | 232 | var newPageNumber = Number(this.currentPageLb.text) - 1; |
231 | 233 | this.currentPageLb.setText('' + newPageNumber); |
232 | 234 | |
... | ... | @@ -245,6 +247,7 @@ Ext.define('amdaDesktop.EpnTapModule', { |
245 | 247 | }, |
246 | 248 | |
247 | 249 | onNextPageBtnClicked: function() { |
250 | + this.wait(); | |
248 | 251 | var newPageNumber = Number(this.currentPageLb.text) + 1; |
249 | 252 | this.currentPageLb.setText('' + newPageNumber); |
250 | 253 | |
... | ... | @@ -263,6 +266,7 @@ Ext.define('amdaDesktop.EpnTapModule', { |
263 | 266 | }, |
264 | 267 | |
265 | 268 | onLastPageBtnClicked: function() { |
269 | + this.wait(); | |
266 | 270 | var newPageNumber = this.totalPagesLb.text; |
267 | 271 | this.currentPageLb.setText('' + newPageNumber); |
268 | 272 | |
... | ... | @@ -281,6 +285,7 @@ Ext.define('amdaDesktop.EpnTapModule', { |
281 | 285 | // *** Grid click events *** |
282 | 286 | |
283 | 287 | onServiceSelected: function(selectedServiceId) { |
288 | + this.wait(); | |
284 | 289 | this.selectedServiceId = selectedServiceId; |
285 | 290 | var selectedServiceURL = this.services[selectedServiceId]['accessurl']; |
286 | 291 | |
... | ... | @@ -345,6 +350,13 @@ Ext.define('amdaDesktop.EpnTapModule', { |
345 | 350 | console.log('Can not add granules: ' + e); |
346 | 351 | } |
347 | 352 | } |
353 | + Ext.getCmp('servicesGrid').setDisabled(false); | |
354 | + Ext.getCmp('servicesGrid').getEl().setStyle('cursor', 'default'); // CSS is correctly changed but without visible result. | |
355 | + }, | |
356 | + | |
357 | + wait: function() { | |
358 | + this.servicesGrid.getEl().setStyle('cursor', 'wait'); | |
359 | + this.servicesGrid.setDisabled(true); // CSS is correctly changed but without visible result. | |
348 | 360 | }, |
349 | 361 | |
350 | 362 | updateServices: function() { |
... | ... |
js/app/views/EpnTapUI.js
... | ... | @@ -87,7 +87,9 @@ Ext.define('amdaUI.EpnTapUI', { |
87 | 87 | {text: 'Name', dataIndex: 'id', flex: 3}, |
88 | 88 | {text: 'Results', dataIndex: 'nbResults', flex: 2} |
89 | 89 | ], |
90 | - renderer: function(value, metadata,record) { return getExpandableImage(value, metadata,record); }, | |
90 | + renderer: function(value, metadata,record) { | |
91 | + return getExpandableImage(value, metadata,record); | |
92 | + }, | |
91 | 93 | listeners: { |
92 | 94 | 'cellclick': function(grid, td, cellIndex, record) { |
93 | 95 | epnTapModule.onServiceSelected(record.data['id']); |
... | ... | @@ -96,15 +98,14 @@ Ext.define('amdaUI.EpnTapUI', { |
96 | 98 | renderTo: Ext.getBody() |
97 | 99 | }); |
98 | 100 | |
99 | - var servicesGridView = this.servicesGrid.getView(); | |
100 | 101 | this.serviceTooltip = new Ext.tip.ToolTip({ |
101 | 102 | id: 'serviceTooltip', |
102 | - target: servicesGridView.el, | |
103 | - delegate: servicesGridView.itemSelector, | |
103 | + target: Ext.getCmp('servicesGrid').getView().el, | |
104 | + delegate: Ext.getCmp('servicesGrid').getView().itemSelector, | |
104 | 105 | trackMouse: true, |
105 | 106 | listeners: { |
106 | 107 | beforeshow: function updateTipBody(tooltip) { |
107 | - var service = servicesGridView.getRecord(tooltip.triggerElement); | |
108 | + var service = Ext.getCmp('servicesGrid').getView().getRecord(tooltip.triggerElement); | |
108 | 109 | var ttContent = '<h3>' + service.get('shortName') + '</h3>'; |
109 | 110 | ttContent += '<p>' + service.get('title') + '</p>'; |
110 | 111 | ttContent += '<p>' + service.get('accessURL') + '</p>'; |
... | ... | @@ -139,15 +140,14 @@ Ext.define('amdaUI.EpnTapUI', { |
139 | 140 | renderTo: Ext.getBody() |
140 | 141 | }); |
141 | 142 | |
142 | - var granulesGridView = this.granulesGrid.getView(); | |
143 | 143 | this.granuleTooltip = new Ext.tip.ToolTip({ |
144 | 144 | id: 'granuleTooltip', |
145 | - target: granulesGridView.el, | |
146 | - delegate: granulesGridView.itemSelector, | |
145 | + target: Ext.getCmp('granulesGrid').getView().el, | |
146 | + delegate: Ext.getCmp('granulesGrid').getView().itemSelector, | |
147 | 147 | trackMouse: true, |
148 | 148 | listeners: { |
149 | 149 | beforeshow: function updateTipBody(tooltip) { |
150 | - var thumb = granulesGridView.getRecord(tooltip.triggerElement).get('thumbnail_url'); | |
150 | + var thumb = Ext.getCmp('granulesGrid').getView().getRecord(tooltip.triggerElement).get('thumbnail_url'); | |
151 | 151 | tooltip.update('<img src="' + thumb + '">'); |
152 | 152 | } |
153 | 153 | }, |
... | ... | @@ -265,7 +265,7 @@ Ext.define('amdaUI.EpnTapUI', { |
265 | 265 | height: 20, |
266 | 266 | value: 20, |
267 | 267 | minValue: 1, |
268 | - maxValue: 500, | |
268 | + maxValue: 2000, | |
269 | 269 | listeners: { |
270 | 270 | 'change': function(rowPerPageNf, newValue) { |
271 | 271 | epnTapModule.onRowsPerPageChanged(newValue); |
... | ... |