aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/report/ReportController.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-05-20 16:57:21 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-05-20 16:57:21 +1200
commit6dfee3947ef96e1092b668ecfc7c58037355ffb8 (patch)
treed29ab479106c97b6443bc9c6a439f315bafa18b0 /web/app/view/report/ReportController.js
parenteb586ea7e074c87444663aa71e9da6f538429ae5 (diff)
downloadtraccar-server-6dfee3947ef96e1092b668ecfc7c58037355ffb8.tar.gz
traccar-server-6dfee3947ef96e1092b668ecfc7c58037355ffb8.tar.bz2
traccar-server-6dfee3947ef96e1092b668ecfc7c58037355ffb8.zip
Implement position report loading
Diffstat (limited to 'web/app/view/report/ReportController.js')
-rw-r--r--web/app/view/report/ReportController.js29
1 files changed, 28 insertions, 1 deletions
diff --git a/web/app/view/report/ReportController.js b/web/app/view/report/ReportController.js
index 92fd1ba7e..48cfda74f 100644
--- a/web/app/view/report/ReportController.js
+++ b/web/app/view/report/ReportController.js
@@ -18,7 +18,34 @@ Ext.define('Traccar.view.report.ReportController', {
extend: 'Ext.app.ViewController',
alias: 'controller.report',
- onSelectionChange: function(selected) {
+ onShowClick: function() {
+
+ var deviceId = this.lookupReference('deviceField').getValue();
+ var fromDate = this.lookupReference('fromDateField').getValue();
+ var fromTime = this.lookupReference('fromTimeField').getValue();
+
+ var from = new Date(
+ fromDate.getYear(), fromDate.getMonth(), fromDate.getDay(),
+ fromTime.getHours(), fromTime.getMinutes(), fromTime.getSeconds(), fromTime.getMilliseconds());
+
+ var toDate = this.lookupReference('toDateField').getValue();
+ var toTime = this.lookupReference('toTimeField').getValue();
+
+ var to = new Date(
+ toDate.getYear(), toDate.getMonth(), toDate.getDay(),
+ toTime.getHours(), toTime.getMinutes(), toTime.getSeconds(), toTime.getMilliseconds());
+
+ var store = Ext.getStore('Positions');
+ store.load({
+ params:{
+ deviceId: deviceId,
+ from: from,
+ to: to
+ }
+ });
+ },
+
+ onClearClick: function() {
}
});