# HG changeset patch # User Torsten Irländer # Date 1371201183 -7200 # Node ID ecb0c0cf386bd81e9a07b6bc19a2c3d1c60e265f # Parent 453985cacb3950134f995bd1404c51528c54ec2a Only add search params if the user actually set them in the form. diff -r 453985cacb39 -r ecb0c0cf386b app/controller/Sql.js --- a/app/controller/Sql.js Thu Jun 13 14:26:37 2013 +0200 +++ b/app/controller/Sql.js Fri Jun 14 11:13:03 2013 +0200 @@ -53,12 +53,20 @@ // Get search parameters: var searchParams = {}; if (Ext.getCmp('search').getValue() == 1) { - searchParams['mst'] = Ext.getCmp('mst').getValue(); - searchParams['uwb'] = Ext.getCmp('uwb').getValue(); + var mst = Ext.getCmp('mst').getValue(); + var uwb = Ext.getCmp('uwb').getValue(); + if (mst !== null) { + searchParams['mst'] = mst; + } + if (uwb !== null) { + searchParams['uwb'] = uwb; + } } else { // Get date object an convert it into a timestamp (ms since epoch) var ts = Ext.getCmp('pbegin').getValue().getTime(); - searchParams['begin'] = ts; + if (ts !== null) { + searchParams['begin'] = ts; + } } result.getStore().load({ params: searchParams