comparison app/controller/Sql.js @ 418:957a4a9fd260

Enabled multiselect for query filter. (Used as example in final workshop)
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 09 Oct 2013 15:02:06 +0200
parents e1af66012ef0
children 2375e7247523
comparison
equal deleted inserted replaced
417:a4eb98a6ea20 418:957a4a9fd260
90 // 2. Iterate over all configured filters 90 // 2. Iterate over all configured filters
91 for (var j=0; j < filterFields.length; j++) { 91 for (var j=0; j < filterFields.length; j++) {
92 var type = filterFields[j].type; 92 var type = filterFields[j].type;
93 var name = filterFields[j].dataIndex; 93 var name = filterFields[j].dataIndex;
94 var label = filterFields[j].label; 94 var label = filterFields[j].label;
95 var multi = filterFields[j].multiSelect;
95 var field = null; 96 var field = null;
96 if (type == "text") { 97 if (type == "text") {
97 console.log("Found text filter"); 98 console.log("Found text filter");
98 field = Ext.create('Ext.form.field.Text', { name: name, fieldLabel: label }); 99 field = Ext.create('Ext.form.field.Text', { name: name, fieldLabel: label });
99 } else if (type == "number") { 100 } else if (type == "number") {
105 } else if (type == "bool") { 106 } else if (type == "bool") {
106 console.log("Found bool filter"); 107 console.log("Found bool filter");
107 field = Ext.create('Lada.view.widgets.Testdatensatz', { name: name, fieldLabel: label, emptyText: '' }); 108 field = Ext.create('Lada.view.widgets.Testdatensatz', { name: name, fieldLabel: label, emptyText: '' });
108 } else if (type == "listmst") { 109 } else if (type == "listmst") {
109 console.log("Found listmst filter"); 110 console.log("Found listmst filter");
110 field = Ext.create('Lada.view.widgets.Mst', { name: name, fieldLabel: label }); 111 field = Ext.create('Lada.view.widgets.Mst', { name: name, fieldLabel: label, multiSelect: multi });
111 } else if (type == "listumw") { 112 } else if (type == "listumw") {
112 console.log("Found listumw filter"); 113 console.log("Found listumw filter");
113 field = Ext.create('Lada.view.widgets.Uwb', { name: name, fieldLabel: label }); 114 field = Ext.create('Lada.view.widgets.Uwb', { name: name, fieldLabel: label, multiSelect: multi });
114 } else if (type == "listdbasis") { 115 } else if (type == "listdbasis") {
115 console.log("Found listdbasis filter"); 116 console.log("Found listdbasis filter");
116 field = Ext.create('Lada.view.widgets.Datenbasis', { name: name, fieldLabel: label }); 117 field = Ext.create('Lada.view.widgets.Datenbasis', { name: name, fieldLabel: label, multiSelect: multi });
117 } else if (type == "listver") { 118 } else if (type == "listver") {
118 console.log("Found listver filter"); 119 console.log("Found listver filter");
119 field = Ext.create('Lada.view.widgets.Verwaltungseinheit', { name: name, fieldLabel: label }); 120 field = Ext.create('Lada.view.widgets.Verwaltungseinheit', { name: name, fieldLabel: label, multiSelect: multi });
120 } else if (type == "listnetz") { 121 } else if (type == "listnetz") {
121 console.log("Found listnetz filter"); 122 console.log("Found listnetz filter");
122 field = Ext.create('Lada.view.widgets.Netzbetreiber', { name: name, fieldLabel: label }); 123 field = Ext.create('Lada.view.widgets.Netzbetreiber', { name: name, fieldLabel: label, multiSelect: multi });
123 } 124 }
124 if (field) { 125 if (field) {
125 console.log("Pushing field to filters"); 126 console.log("Pushing field to filters");
126 filters.add(field); 127 filters.add(field);
127 filters.show(); 128 filters.show();

http://lada.wald.intevation.org