aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-06-01 10:20:49 +0500
committerAbyss777 <abyss@fox5.ru>2016-06-01 10:20:49 +0500
commite6a635ac7a1ef8b674da1a01f024a4a58375e487 (patch)
tree9c65b2449d2e4617dbcec276b36feebd8b3b4d72 /web
parentab35686de46a23dd0c7974c6426b3d60eba05228 (diff)
downloadtrackermap-server-e6a635ac7a1ef8b674da1a01f024a4a58375e487.tar.gz
trackermap-server-e6a635ac7a1ef8b674da1a01f024a4a58375e487.tar.bz2
trackermap-server-e6a635ac7a1ef8b674da1a01f024a4a58375e487.zip
Handle store update event in right place
Diffstat (limited to 'web')
-rw-r--r--web/app/store/Devices.js6
-rw-r--r--web/app/view/Devices.js1
-rw-r--r--web/app/view/DevicesController.js9
3 files changed, 9 insertions, 7 deletions
diff --git a/web/app/store/Devices.js b/web/app/store/Devices.js
index 5084ff554..8ba513792 100644
--- a/web/app/store/Devices.js
+++ b/web/app/store/Devices.js
@@ -24,11 +24,5 @@ Ext.define('Traccar.store.Devices', {
writer: {
writeAllFields: true
}
- },
- listeners : {
- update: function () {
- devicesPanel = Ext.getCmp('devicesPanel');
- devicesPanel.fireEvent('selectionchange',devicesPanel.getSelectionModel());
- }
}
});
diff --git a/web/app/view/Devices.js b/web/app/view/Devices.js
index 31eead2f7..f06c2658b 100644
--- a/web/app/view/Devices.js
+++ b/web/app/view/Devices.js
@@ -17,7 +17,6 @@
Ext.define('Traccar.view.Devices', {
extend: 'Ext.grid.Panel',
xtype: 'devicesView',
- id: 'devicesPanel',
requires: [
'Traccar.view.DevicesController',
diff --git a/web/app/view/DevicesController.js b/web/app/view/DevicesController.js
index 8c1bba00f..0f8c5249f 100644
--- a/web/app/view/DevicesController.js
+++ b/web/app/view/DevicesController.js
@@ -30,6 +30,11 @@ Ext.define('Traccar.view.DevicesController', {
selectDevice: 'selectDevice',
selectReport: 'selectReport'
}
+ },
+ store: {
+ '*': {
+ update: 'onUpdateDevice'
+ }
}
}
},
@@ -117,5 +122,9 @@ Ext.define('Traccar.view.DevicesController', {
if (position !== undefined) {
this.getView().getSelectionModel().deselectAll();
}
+ },
+
+ onUpdateDevice: function () {
+ this.view.fireEvent('selectionchange',this.view.getSelectionModel());
}
});