Commit 96550534bea0e9383860dea94f1e294f587beb4e

Authored by Nathanael Jourdane
1 parent 0c2b3220

epntap: Make productType cb multiselectable and add *all* and *clear* items

Showing 1 changed file with 19 additions and 1 deletions   Show diff stats
js/app/views/EpnTapUI.js
@@ -31,6 +31,8 @@ Ext.create('Ext.data.Store', { @@ -31,6 +31,8 @@ Ext.create('Ext.data.Store', {
31 storeId:'productTypesStore', 31 storeId:'productTypesStore',
32 fields: ['id', 'name'], 32 fields: ['id', 'name'],
33 data: [ 33 data: [
  34 + {'id': 'all', 'name': '--All--'},
  35 + {'id': 'clear', 'name': '--Clear--'},
34 {'id': 'im', 'name': 'Image'}, 36 {'id': 'im', 'name': 'Image'},
35 {'id': 'ma', 'name': 'Map'}, 37 {'id': 'ma', 'name': 'Map'},
36 {'id': 'sp', 'name': 'Spectrum'}, 38 {'id': 'sp', 'name': 'Spectrum'},
@@ -234,12 +236,28 @@ Ext.define('amdaUI.EpnTapUI', { @@ -234,12 +236,28 @@ Ext.define('amdaUI.EpnTapUI', {
234 xtype: 'combobox', 236 xtype: 'combobox',
235 id: 'epnTapProductTypeCB', 237 id: 'epnTapProductTypeCB',
236 fieldLabel: 'Product type', 238 fieldLabel: 'Product type',
  239 + emptyText: 'Image, Time series, ...',
237 store: Ext.data.StoreManager.lookup('productTypesStore'), 240 store: Ext.data.StoreManager.lookup('productTypesStore'),
238 queryMode: 'local', 241 queryMode: 'local',
239 valueField: 'id', 242 valueField: 'id',
  243 + multiSelect: true,
240 displayField: 'name', 244 displayField: 'name',
241 maxWidth: 100, 245 maxWidth: 100,
242 - editable: false 246 + editable: false,
  247 + listeners: {
  248 + select: function(combo, records) {
  249 + switch (combo.value[combo.value.length - 1]) {
  250 + case "all":
  251 + combo.select(combo.store.getRange().slice(2));
  252 + break;
  253 + case "clear":
  254 + combo.reset();
  255 + break;
  256 + default:
  257 + break;
  258 + }
  259 + }
  260 + }
243 }; 261 };
244 }, 262 },
245 263