aboutsummaryrefslogtreecommitdiff
path: root/web/app
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-06-26 19:22:04 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-06-26 19:22:04 +1200
commit88c87b2ce54733c06db810e51a749797ba03e913 (patch)
tree5050e6292baff2396ff84618c878e96212ba682e /web/app
parent8bee4f349397ce03cbc9c88b2b173dd8fa599c44 (diff)
downloadtrackermap-server-88c87b2ce54733c06db810e51a749797ba03e913.tar.gz
trackermap-server-88c87b2ce54733c06db810e51a749797ba03e913.tar.bz2
trackermap-server-88c87b2ce54733c06db810e51a749797ba03e913.zip
Sync device and report selections
Diffstat (limited to 'web/app')
-rw-r--r--web/app/view/device/DeviceController.js16
-rw-r--r--web/app/view/report/ReportController.js16
2 files changed, 32 insertions, 0 deletions
diff --git a/web/app/view/device/DeviceController.js b/web/app/view/device/DeviceController.js
index 158f6c52c..ba9eabb5a 100644
--- a/web/app/view/device/DeviceController.js
+++ b/web/app/view/device/DeviceController.js
@@ -25,6 +25,16 @@ Ext.define('Traccar.view.device.DeviceController', {
'Traccar.view.user.User'
],
+ config: {
+ listen: {
+ controller: {
+ '*': {
+ selectReport: 'selectReport'
+ }
+ }
+ }
+ },
+
init: function() {
if (Traccar.getApplication().getUser().get('admin')) {
this.lookupReference('settingsServerButton').setDisabled(false);
@@ -104,6 +114,12 @@ Ext.define('Traccar.view.device.DeviceController', {
xtype: 'user-view'
}
}).show();
+ },
+
+ selectReport: function(position) {
+ if (position !== undefined) {
+ this.getView().getSelectionModel().deselectAll();
+ }
}
});
diff --git a/web/app/view/report/ReportController.js b/web/app/view/report/ReportController.js
index daeb8ddfc..ffc75dc1c 100644
--- a/web/app/view/report/ReportController.js
+++ b/web/app/view/report/ReportController.js
@@ -18,6 +18,16 @@ Ext.define('Traccar.view.report.ReportController', {
extend: 'Ext.app.ViewController',
alias: 'controller.report',
+ config: {
+ listen: {
+ controller: {
+ '*': {
+ selectDevice: 'selectDevice'
+ }
+ }
+ }
+ },
+
onShowClick: function() {
var deviceId = this.lookupReference('deviceField').getValue();
@@ -58,6 +68,12 @@ Ext.define('Traccar.view.report.ReportController', {
if (selected.getCount() > 0) {
this.fireEvent("selectReport", selected.getLastSelected());
}
+ },
+
+ selectDevice: function(device) {
+ if (device !== undefined) {
+ this.getView().getSelectionModel().deselectAll();
+ }
}
});