comparison app/view/FilterPanel.js @ 1015:af9879d72310

Updated UI, added window for filter management and added fieldset for query details.
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 02 Feb 2016 15:25:16 +0100
parents 2e81d2ad6af7
children d6e259e76de6
comparison
equal deleted inserted replaced
1010:94a6b5415d73 1015:af9879d72310
15 15
16 require: [ 16 require: [
17 'Ext.layout.container.Column' 17 'Ext.layout.container.Column'
18 ], 18 ],
19 19
20 title: 'Filter-Auswahl', 20 title: 'Filter',
21 initComponent: function() { 21 initComponent: function() {
22 this.layout = { 22 this.layout = {
23 type: 'vbox', 23 type: 'vbox',
24 align: 'stretch' 24 align: 'stretch'
25 }; 25 };
26 var me = this; 26 var me = this;
27 this.items = [{ 27 this.items = [{
28 xtype: 'combobox', 28 layout: 'hbox',
29 name: 'filter', 29 border: false,
30 editable: false, 30 items: [{
31 store: Ext.create('Lada.store.ProbeQueries',{ 31 xtype: 'combobox',
32 listeners: { 32 name: 'filter',
33 load: function(s){ 33 editable: false,
34 var records = new Array(); 34 flex: 1,
35 records.push(s.getAt(0)); 35 displayField: 'name',
36 36 valueField: 'id',
37 var combo = me.down('combobox[name=filter]'); 37 queryMode: 'local',
38 combo.select(records[0]); 38 emptyText: 'Wählen Sie eine Abfrage'
39 combo.fireEvent('select', combo, records); 39 }, {
40 } 40 xtype: 'button',
41 } 41 action: 'details',
42 }), 42 enableToggle: true,
43 displayField: 'name', 43 text: 'Details',
44 valueField: 'id', 44 margin: '0 0 0 10'
45 emptyText: 'Wählen Sie eine Abfrage' 45 }]
46 }, {
47 xtype: 'checkbox',
48 name: 'favorites',
49 boxLabel: 'nur Favoriten',
50 margin: '0, 0, 0, 5',
51 checked: true
52 }, {
53 xtype: 'displayfield',
54 name: 'description',
55 shrinkWrap: 3,
56 margin: '0, 0, 0 ,5',
57 value: '-/-'
46 }, { 58 }, {
47 xtype: 'panel', 59 xtype: 'panel',
48 border: false, 60 border: false,
49 margin: '0 0 10 0', 61 margin: '0 0 10 0',
50 items: [{ 62 items: [{
53 text: 'Suchen', 65 text: 'Suchen',
54 margin: '0 10 0 0' 66 margin: '0 10 0 0'
55 }, { 67 }, {
56 xtype: 'button', 68 xtype: 'button',
57 action: 'reset', 69 action: 'reset',
58 text: 'Zurücksetzen' 70 text: 'Zurücksetzen',
71 margin: '0 10 0 0'
72 }, {
73 xtype: 'button',
74 action: 'manage',
75 text: 'Filterauswahl bearbeiten'
59 }], 76 }],
60 hidden: false 77 hidden: false
61 }, {
62 xtype: 'panel',
63 maxWidth: '500',
64 border: false,
65 margin: '0 10',
66 items: [{
67 xtype: 'displayfield',
68 name: 'description',
69 fieldLabel: 'Beschreibung',
70 shrinkWrap: 3,
71 value: '-/-'
72 }, {
73 xtype: 'displayfield',
74 name: 'columns',
75 fieldLabel: 'Spalten',
76 value: '-/-'
77 }]
78 }]; 78 }];
79 this.callParent(arguments); 79 this.callParent(arguments);
80 var combo = me.down('combobox[name=filter]');
81 combo.store = Ext.create('Ext.data.Store', {
82 model: 'Lada.model.Query'
83 });
84 var store = Ext.StoreManager.get('probequeries');
85 store.on('load', function storeLoad () {
86 var entries = store.queryBy(function(record) {
87 if (record.get('favorite')) {
88 return true;
89 }
90 });
91 combo.store.add(entries.items);
92 combo.select(combo.store.getAt(0));
93 combo.fireEvent('select', combo, [combo.store.getAt(0)]);
94 store.un('load', storeLoad);
95 });
80 } 96 }
81 }); 97 });

http://lada.wald.intevation.org