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,6 +212,7 @@ Ext.define('amdaDesktop.EpnTapModule', { | ||
212 | // *** Buttons events *** | 212 | // *** Buttons events *** |
213 | 213 | ||
214 | onFirstPageBtnClicked: function() { | 214 | onFirstPageBtnClicked: function() { |
215 | + this.wait(); | ||
215 | this.currentPageLb.setText('1'); | 216 | this.currentPageLb.setText('1'); |
216 | 217 | ||
217 | this.nextBtn.setDisabled(false); | 218 | this.nextBtn.setDisabled(false); |
@@ -227,6 +228,7 @@ Ext.define('amdaDesktop.EpnTapModule', { | @@ -227,6 +228,7 @@ Ext.define('amdaDesktop.EpnTapModule', { | ||
227 | }, | 228 | }, |
228 | 229 | ||
229 | onPreviousPageBtnClicked: function() { | 230 | onPreviousPageBtnClicked: function() { |
231 | + this.wait(); | ||
230 | var newPageNumber = Number(this.currentPageLb.text) - 1; | 232 | var newPageNumber = Number(this.currentPageLb.text) - 1; |
231 | this.currentPageLb.setText('' + newPageNumber); | 233 | this.currentPageLb.setText('' + newPageNumber); |
232 | 234 | ||
@@ -245,6 +247,7 @@ Ext.define('amdaDesktop.EpnTapModule', { | @@ -245,6 +247,7 @@ Ext.define('amdaDesktop.EpnTapModule', { | ||
245 | }, | 247 | }, |
246 | 248 | ||
247 | onNextPageBtnClicked: function() { | 249 | onNextPageBtnClicked: function() { |
250 | + this.wait(); | ||
248 | var newPageNumber = Number(this.currentPageLb.text) + 1; | 251 | var newPageNumber = Number(this.currentPageLb.text) + 1; |
249 | this.currentPageLb.setText('' + newPageNumber); | 252 | this.currentPageLb.setText('' + newPageNumber); |
250 | 253 | ||
@@ -263,6 +266,7 @@ Ext.define('amdaDesktop.EpnTapModule', { | @@ -263,6 +266,7 @@ Ext.define('amdaDesktop.EpnTapModule', { | ||
263 | }, | 266 | }, |
264 | 267 | ||
265 | onLastPageBtnClicked: function() { | 268 | onLastPageBtnClicked: function() { |
269 | + this.wait(); | ||
266 | var newPageNumber = this.totalPagesLb.text; | 270 | var newPageNumber = this.totalPagesLb.text; |
267 | this.currentPageLb.setText('' + newPageNumber); | 271 | this.currentPageLb.setText('' + newPageNumber); |
268 | 272 | ||
@@ -281,6 +285,7 @@ Ext.define('amdaDesktop.EpnTapModule', { | @@ -281,6 +285,7 @@ Ext.define('amdaDesktop.EpnTapModule', { | ||
281 | // *** Grid click events *** | 285 | // *** Grid click events *** |
282 | 286 | ||
283 | onServiceSelected: function(selectedServiceId) { | 287 | onServiceSelected: function(selectedServiceId) { |
288 | + this.wait(); | ||
284 | this.selectedServiceId = selectedServiceId; | 289 | this.selectedServiceId = selectedServiceId; |
285 | var selectedServiceURL = this.services[selectedServiceId]['accessurl']; | 290 | var selectedServiceURL = this.services[selectedServiceId]['accessurl']; |
286 | 291 | ||
@@ -345,6 +350,13 @@ Ext.define('amdaDesktop.EpnTapModule', { | @@ -345,6 +350,13 @@ Ext.define('amdaDesktop.EpnTapModule', { | ||
345 | console.log('Can not add granules: ' + e); | 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 | updateServices: function() { | 362 | updateServices: function() { |
js/app/views/EpnTapUI.js
@@ -87,7 +87,9 @@ Ext.define('amdaUI.EpnTapUI', { | @@ -87,7 +87,9 @@ Ext.define('amdaUI.EpnTapUI', { | ||
87 | {text: 'Name', dataIndex: 'id', flex: 3}, | 87 | {text: 'Name', dataIndex: 'id', flex: 3}, |
88 | {text: 'Results', dataIndex: 'nbResults', flex: 2} | 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 | listeners: { | 93 | listeners: { |
92 | 'cellclick': function(grid, td, cellIndex, record) { | 94 | 'cellclick': function(grid, td, cellIndex, record) { |
93 | epnTapModule.onServiceSelected(record.data['id']); | 95 | epnTapModule.onServiceSelected(record.data['id']); |
@@ -96,15 +98,14 @@ Ext.define('amdaUI.EpnTapUI', { | @@ -96,15 +98,14 @@ Ext.define('amdaUI.EpnTapUI', { | ||
96 | renderTo: Ext.getBody() | 98 | renderTo: Ext.getBody() |
97 | }); | 99 | }); |
98 | 100 | ||
99 | - var servicesGridView = this.servicesGrid.getView(); | ||
100 | this.serviceTooltip = new Ext.tip.ToolTip({ | 101 | this.serviceTooltip = new Ext.tip.ToolTip({ |
101 | id: 'serviceTooltip', | 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 | trackMouse: true, | 105 | trackMouse: true, |
105 | listeners: { | 106 | listeners: { |
106 | beforeshow: function updateTipBody(tooltip) { | 107 | beforeshow: function updateTipBody(tooltip) { |
107 | - var service = servicesGridView.getRecord(tooltip.triggerElement); | 108 | + var service = Ext.getCmp('servicesGrid').getView().getRecord(tooltip.triggerElement); |
108 | var ttContent = '<h3>' + service.get('shortName') + '</h3>'; | 109 | var ttContent = '<h3>' + service.get('shortName') + '</h3>'; |
109 | ttContent += '<p>' + service.get('title') + '</p>'; | 110 | ttContent += '<p>' + service.get('title') + '</p>'; |
110 | ttContent += '<p>' + service.get('accessURL') + '</p>'; | 111 | ttContent += '<p>' + service.get('accessURL') + '</p>'; |
@@ -139,15 +140,14 @@ Ext.define('amdaUI.EpnTapUI', { | @@ -139,15 +140,14 @@ Ext.define('amdaUI.EpnTapUI', { | ||
139 | renderTo: Ext.getBody() | 140 | renderTo: Ext.getBody() |
140 | }); | 141 | }); |
141 | 142 | ||
142 | - var granulesGridView = this.granulesGrid.getView(); | ||
143 | this.granuleTooltip = new Ext.tip.ToolTip({ | 143 | this.granuleTooltip = new Ext.tip.ToolTip({ |
144 | id: 'granuleTooltip', | 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 | trackMouse: true, | 147 | trackMouse: true, |
148 | listeners: { | 148 | listeners: { |
149 | beforeshow: function updateTipBody(tooltip) { | 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 | tooltip.update('<img src="' + thumb + '">'); | 151 | tooltip.update('<img src="' + thumb + '">'); |
152 | } | 152 | } |
153 | }, | 153 | }, |
@@ -265,7 +265,7 @@ Ext.define('amdaUI.EpnTapUI', { | @@ -265,7 +265,7 @@ Ext.define('amdaUI.EpnTapUI', { | ||
265 | height: 20, | 265 | height: 20, |
266 | value: 20, | 266 | value: 20, |
267 | minValue: 1, | 267 | minValue: 1, |
268 | - maxValue: 500, | 268 | + maxValue: 2000, |
269 | listeners: { | 269 | listeners: { |
270 | 'change': function(rowPerPageNf, newValue) { | 270 | 'change': function(rowPerPageNf, newValue) { |
271 | epnTapModule.onRowsPerPageChanged(newValue); | 271 | epnTapModule.onRowsPerPageChanged(newValue); |