# HG changeset patch # User Torsten Irländer # Date 1369320642 -7200 # Node ID 2a67e062519bfc842888941033c9438cc6c8045f # Parent 3f801444b8d5cbbb30cf558e0c6987d4b971ea3a Implemted search. When user clicks on the search buttons parameters are fetched and a query url is the generated. diff -r 3f801444b8d5 -r 2a67e062519b app/controller/Sql.js --- a/app/controller/Sql.js Thu May 23 16:09:05 2013 +0200 +++ b/app/controller/Sql.js Thu May 23 16:50:42 2013 +0200 @@ -49,7 +49,20 @@ search: function(element, record, index) { var result = Ext.getCmp('result'); console.log('Loading store'); - result.getStore().load(); + + // Get search parameters: + var searchParams = {}; + if (Ext.getCmp('search').getValue() == 1) { + searchParams['mst'] = Ext.getCmp('mst').getValue(); + searchParams['uwb'] = Ext.getCmp('uwb').getValue(); + } else { + // Get date object an convert it into a timestamp (ms since epoch) + var ts = Ext.getCmp('pbegin').getValue().getTime(); + searchParams['begin'] = ts; + } + result.getStore().load({ + params: searchParams + }); console.log('Store loaded'); result.show(); }, diff -r 3f801444b8d5 -r 2a67e062519b app/store/Proben.js --- a/app/store/Proben.js Thu May 23 16:09:05 2013 +0200 +++ b/app/store/Proben.js Thu May 23 16:50:42 2013 +0200 @@ -3,8 +3,8 @@ model: 'Lada.model.Probe', proxy: { type: 'ajax', + url: 'server/rest/proben', api: { - read: 'server/rest/proben' }, reader: { type: 'json'