annotate app/controller/Sql.js @ 35:3f801444b8d5

Added store for Messstelle. Fill Messstellen widget on search page dynamically.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Thu, 23 May 2013 16:09:05 +0200
parents a35119566841
children 2a67e062519b
rev   line source
31
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
1 var queries = new Array('query1', 'query2');
6
8e79bda4d55b Added a list to select predefined SQL Statement for the Proben list.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
2 Ext.define('Lada.controller.Sql', {
8e79bda4d55b Added a list to select predefined SQL Statement for the Proben list.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
3 extend: 'Ext.app.Controller',
8e79bda4d55b Added a list to select predefined SQL Statement for the Proben list.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
4 views: [
28
4d60b9ebce15 Renamed sql modul into search. Further display The query selection as Combobox
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 25
diff changeset
5 'search.List'
6
8e79bda4d55b Added a list to select predefined SQL Statement for the Proben list.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
6 ],
8
e4fcb4ddd782 Moved stored SQL into its own file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 6
diff changeset
7 stores: [
33
a35119566841 Fetch UWB dynamically.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 31
diff changeset
8 'Sql',
35
3f801444b8d5 Added store for Messstelle. Fill Messstellen widget on search page
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 33
diff changeset
9 'Uwb',
3f801444b8d5 Added store for Messstelle. Fill Messstellen widget on search page
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 33
diff changeset
10 'Mst'
8
e4fcb4ddd782 Moved stored SQL into its own file.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 6
diff changeset
11 ],
6
8e79bda4d55b Added a list to select predefined SQL Statement for the Proben list.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
12 init: function() {
8e79bda4d55b Added a list to select predefined SQL Statement for the Proben list.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
13 console.log('Initialising the Sql controller');
8e79bda4d55b Added a list to select predefined SQL Statement for the Proben list.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
14 this.control({
8e79bda4d55b Added a list to select predefined SQL Statement for the Proben list.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
15 // CSS like selector to select element in the viewport. See
8e79bda4d55b Added a list to select predefined SQL Statement for the Proben list.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
16 // ComponentQuery documentation for more details.
31
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
17 '#search': {
6
8e79bda4d55b Added a list to select predefined SQL Statement for the Proben list.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
18 // Map the "render" event to the given function.
8e79bda4d55b Added a list to select predefined SQL Statement for the Proben list.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
19 render: this.onPanelRendered,
8e79bda4d55b Added a list to select predefined SQL Statement for the Proben list.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
20 // Map Doubleclick on rows of the probenlist.
28
4d60b9ebce15 Renamed sql modul into search. Further display The query selection as Combobox
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 25
diff changeset
21 select: this.selectSql
31
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
22 },
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
23 '#SearchBtn': {
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
24 // Map click event on Button.
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
25 click: this.search
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
26 },
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
27 '#ResetBtn': {
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
28 // Map click event on Button.
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
29 click: this.reset
6
8e79bda4d55b Added a list to select predefined SQL Statement for the Proben list.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
30 }
8e79bda4d55b Added a list to select predefined SQL Statement for the Proben list.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
31 });
8e79bda4d55b Added a list to select predefined SQL Statement for the Proben list.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
32 },
8e79bda4d55b Added a list to select predefined SQL Statement for the Proben list.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
33 onPanelRendered: function() {
8e79bda4d55b Added a list to select predefined SQL Statement for the Proben list.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
34 console.log('The panel was rendered');
8e79bda4d55b Added a list to select predefined SQL Statement for the Proben list.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
35 },
28
4d60b9ebce15 Renamed sql modul into search. Further display The query selection as Combobox
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 25
diff changeset
36 selectSql: function(element, record, index) {
31
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
37 var selection = element.getValue() - 1;
25
f964a50bfe57 Restructured the application. Fixed layouts etc.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 17
diff changeset
38 console.log('Selected SQL ' + selection);
31
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
39 for (var i = 0; i < queries.length; ++i) {
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
40 var toHide = Ext.getCmp(queries[i]);
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
41 toHide.hide();
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
42 }
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
43 var toShow = Ext.getCmp(queries[selection]);
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
44 var buttons = Ext.getCmp('SearchBtnPanel');
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
45 this.reset();
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
46 toShow.show();
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
47 buttons.show();
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
48 },
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
49 search: function(element, record, index) {
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
50 var result = Ext.getCmp('result');
28
4d60b9ebce15 Renamed sql modul into search. Further display The query selection as Combobox
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 25
diff changeset
51 console.log('Loading store');
25
f964a50bfe57 Restructured the application. Fixed layouts etc.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 17
diff changeset
52 result.getStore().load();
28
4d60b9ebce15 Renamed sql modul into search. Further display The query selection as Combobox
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 25
diff changeset
53 console.log('Store loaded');
25
f964a50bfe57 Restructured the application. Fixed layouts etc.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 17
diff changeset
54 result.show();
31
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
55 },
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
56 reset: function(element, record, index) {
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
57 var buttons = Ext.getCmp('SearchBtnPanel');
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
58 var result = Ext.getCmp('result');
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
59 for (var i = 0; i < queries.length; ++i) {
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
60 var toHide = Ext.getCmp(queries[i]);
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
61 toHide.hide();
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
62 }
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
63 result.hide();
897e3100c6da Changed logic of the Probenauswahl. Now logic works like the BFS version.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 28
diff changeset
64 buttons.hide();
6
8e79bda4d55b Added a list to select predefined SQL Statement for the Proben list.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
65 }
8e79bda4d55b Added a list to select predefined SQL Statement for the Proben list.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
66 });

http://lada.wald.intevation.org