Commit 1227cc879ede634026bca5a213585b2645d494a7

Authored by Nathanael Jourdane
1 parent 494949bb

Fix the scrollbar bug

js/app/controllers/EpnTapModule.js
... ... @@ -198,17 +198,13 @@ Ext.define('amdaDesktop.EpnTapModule', {
198 198 this.lastPageBtn = Ext.getCmp('epnTapLastPageBtn');
199 199 this.epnTapPanel = this.productTypeCB.findParentByType('panelEpnTap');
200 200  
201   - for(var i = 0; i < 30; i++) {
202   - Ext.getCmp('epnTapServicesGrid').getStore().add({});
203   - }
204   -
205 201 // Update productTypeCB
206 202 this.productTypeCB.getStore().add({'id': 'all', 'name': 'All data product types'});
207 203 for (var productTypeId in this.metadata) {
208 204 if (productTypeId in productTypeDict) {
209 205 this.productTypeCB.getStore().add({'id': productTypeId, 'name': this.prettify(productTypeDict[productTypeId])});
210 206 } else {
211   - console.log('Unknown data product type "' + productTypeId + '"');
  207 + // console.log('Unknown data product type "' + productTypeId + '"');
212 208 }
213 209 }
214 210  
... ... @@ -460,7 +456,7 @@ Ext.define(&#39;amdaDesktop.EpnTapModule&#39;, {
460 456 for debug purposes only.
461 457 */
462 458 onGranuleSelected: function(granule) {
463   - // console.log('selected granule: ' + granule['target_name']);
  459 + // console.log('selected granule: ', granule);
464 460 },
465 461  
466 462 /**********************
... ... @@ -578,6 +574,7 @@ Ext.define(&#39;amdaDesktop.EpnTapModule&#39;, {
578 574 Among other things, update the `epnTapCurrentPageLb` label (see `EpnTapUI.createNavigationPanel()`).
579 575 */
580 576 updateNbRows: function(nb_results) {
  577 + // console.log(nb_results + ' granules found.')
581 578 var totalPages = Math.ceil(Number(nb_results) / Ext.getCmp('epnTapRowsPerPageNf').value);
582 579  
583 580 Ext.getCmp('epnTapCurrentPageLb').setText(totalPages == 0 ? '-' : '1');
... ... @@ -605,7 +602,7 @@ Ext.define(&#39;amdaDesktop.EpnTapModule&#39;, {
605 602 Ext.getCmp('epnTapGranulesGrid').getStore().removeAll();
606 603 Ext.getCmp('epnTapGranulesGrid').getStore().add(granules);
607 604 } catch( e ) {
608   - console.log('Can not add granules: ' + e);
  605 + // console.log('Can not add granules: ' + e);
609 606 }
610 607 }
611 608 Ext.getCmp('epnTapServicesGrid').setDisabled(false);
... ...
js/app/views/EpnTapUI.js
... ... @@ -89,7 +89,7 @@ Ext.create(&#39;Ext.data.Store&#39;, {
89 89  
90 90 /**
91 91 `granulesStore`: An ExtJS Store containing the list of granules of the selected service (on `servicesGrid`), which match
92   -with the granules filter (the selected data product type, target class and target name).
  92 +with tge granules filter (the selected data product type, target class and target name).
93 93  
94 94 This list is used to fill the `granulesGrid` table, which is updated by `EpnTapModule` each time a new service is
95 95 selected.
... ... @@ -170,10 +170,7 @@ Ext.define(&#39;amdaUI.EpnTapUI&#39;, {
170 170 title: 'Services',
171 171 store: Ext.data.StoreManager.lookup('servicesStore'),
172 172 flex: 1,
173   - // layout: 'fit',
174   - // scroll: 'vertical',
175   - // autoScroll: 'auto',
176   - height: 530,
  173 + height: 405,
177 174 columns: [
178 175 {text: 'Name', dataIndex: 'id', flex: 3},
179 176 {text: 'Results', dataIndex: 'nbResults', flex: 2}
... ... @@ -231,27 +228,21 @@ Ext.define(&#39;amdaUI.EpnTapUI&#39;, {
231 228 */
232 229 var createGranulesGrid = function() {
233 230 var txtRender = function(val) {
234   - console.log('txtRender: ' + val);
235 231 return '<p style="white-space: normal;">' + val + '</p>';
236 232 };
237 233 var linkRender = function(val) {
238   - console.log('linkRender: ' + val);
239 234 return '<a href="' + val + '">data</a>';
240 235 };
241 236 var imgRender = function(val) {
242   - console.log('imgRender: ' + val);
243 237 return '<img width="40px height="40px" src="' + val + '">';
244 238 };
245 239 var dptRender = function(val) {
246   - console.log('dptRender: ' + val);
247 240 return (val in mod.productTypeDict) ? '<p style="white-space: normal;">' + mod.productTypeDict[val] + '</p>' : '<em>' + val + '</em>';
248 241 };
249 242 var formatRender = function(val) {
250   - console.log('formatRender: ' + val);
251 243 return (val in mod.mimetypeDict) ? mod.mimetypeDict[val] : '<em style="white-space: normal;">' + val + '</em>';
252 244 };
253 245 var sizeRender = function(val) {
254   - console.log('sizeRender: ' + val);
255 246 var size = parseInt(val);
256 247 if (isNaN(size)) {
257 248 return '';
... ... @@ -272,7 +263,7 @@ Ext.define(&#39;amdaUI.EpnTapUI&#39;, {
272 263 // layout: 'fit',
273 264 // scroll: 'vertical',
274 265 // autoScroll: 'auto',
275   - // height: 500,
  266 + height: 405,
276 267 columns: [
277 268 { text: 'Num', dataIndex: 'num', flex: 1, renderer: txtRender },
278 269 // { text: 'Type', dataIndex: 'dataproduct_type', flex: 2, renderer: dptRender },
... ... @@ -286,7 +277,7 @@ Ext.define(&#39;amdaUI.EpnTapUI&#39;, {
286 277 { text: 'Thumb.', dataIndex: 'thumbnail_url', flex: 1, renderer: imgRender}
287 278 ],
288 279 listeners: {
289   - 'cellclick': function(grid, td, cellIndex, record) { mod.onGranuleSelected(record.data); }
  280 + 'cellclick': function(grid, td, cellIndex, record) { mod.onGranuleSelected(record.data['id']); }
290 281 },
291 282 renderTo: Ext.getBody()
292 283 });
... ... @@ -318,8 +309,8 @@ Ext.define(&#39;amdaUI.EpnTapUI&#39;, {
318 309 return new Ext.panel.Panel({
319 310 id: 'epnTapGridsPanel',
320 311 region: 'center',
321   - layout: { type: 'hbox', pack: 'start', align: 'stretch' },
322   - // height: 530,
  312 + layout: { type: 'hbox' },
  313 + height: 530,
323 314 items: [
324 315 createServicesGrid(),
325 316 createGranulesGrid()
... ...