Commit 96550534bea0e9383860dea94f1e294f587beb4e
1 parent
0c2b3220
Exists in
master
and in
112 other branches
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 | 31 | storeId:'productTypesStore', |
32 | 32 | fields: ['id', 'name'], |
33 | 33 | data: [ |
34 | + {'id': 'all', 'name': '--All--'}, | |
35 | + {'id': 'clear', 'name': '--Clear--'}, | |
34 | 36 | {'id': 'im', 'name': 'Image'}, |
35 | 37 | {'id': 'ma', 'name': 'Map'}, |
36 | 38 | {'id': 'sp', 'name': 'Spectrum'}, |
... | ... | @@ -234,12 +236,28 @@ Ext.define('amdaUI.EpnTapUI', { |
234 | 236 | xtype: 'combobox', |
235 | 237 | id: 'epnTapProductTypeCB', |
236 | 238 | fieldLabel: 'Product type', |
239 | + emptyText: 'Image, Time series, ...', | |
237 | 240 | store: Ext.data.StoreManager.lookup('productTypesStore'), |
238 | 241 | queryMode: 'local', |
239 | 242 | valueField: 'id', |
243 | + multiSelect: true, | |
240 | 244 | displayField: 'name', |
241 | 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 | |
... | ... |