Mercurial > lada > lada-client
comparison app/controller/Sql.js @ 36:2a67e062519b
Implemted search. When user clicks on the search buttons parameters are
fetched and a query url is the generated.
author | Torsten Irländer <torsten.irlaender@intevation.de> |
---|---|
date | Thu, 23 May 2013 16:50:42 +0200 |
parents | 3f801444b8d5 |
children | ecb0c0cf386b |
comparison
equal
deleted
inserted
replaced
35:3f801444b8d5 | 36:2a67e062519b |
---|---|
47 buttons.show(); | 47 buttons.show(); |
48 }, | 48 }, |
49 search: function(element, record, index) { | 49 search: function(element, record, index) { |
50 var result = Ext.getCmp('result'); | 50 var result = Ext.getCmp('result'); |
51 console.log('Loading store'); | 51 console.log('Loading store'); |
52 result.getStore().load(); | 52 |
53 // Get search parameters: | |
54 var searchParams = {}; | |
55 if (Ext.getCmp('search').getValue() == 1) { | |
56 searchParams['mst'] = Ext.getCmp('mst').getValue(); | |
57 searchParams['uwb'] = Ext.getCmp('uwb').getValue(); | |
58 } else { | |
59 // Get date object an convert it into a timestamp (ms since epoch) | |
60 var ts = Ext.getCmp('pbegin').getValue().getTime(); | |
61 searchParams['begin'] = ts; | |
62 } | |
63 result.getStore().load({ | |
64 params: searchParams | |
65 }); | |
53 console.log('Store loaded'); | 66 console.log('Store loaded'); |
54 result.show(); | 67 result.show(); |
55 }, | 68 }, |
56 reset: function(element, record, index) { | 69 reset: function(element, record, index) { |
57 var buttons = Ext.getCmp('SearchBtnPanel'); | 70 var buttons = Ext.getCmp('SearchBtnPanel'); |