aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-08-10 17:10:29 +1200
committerGitHub <noreply@github.com>2017-08-10 17:10:29 +1200
commit9a536a3ef3b8972c64de2de76a340115ab036d3f (patch)
treefd816e4b99dbfbb0d27a2b08d8ff3482536876da /web
parent7f02408334f80197db0ce10e42b3c77f72e64f61 (diff)
parentfc63eb7db5f98d707d63fe82989ab235759fbb29 (diff)
downloadetbsa-traccar-web-9a536a3ef3b8972c64de2de76a340115ab036d3f.tar.gz
etbsa-traccar-web-9a536a3ef3b8972c64de2de76a340115ab036d3f.tar.bz2
etbsa-traccar-web-9a536a3ef3b8972c64de2de76a340115ab036d3f.zip
Merge pull request #546 from Abyss777/load_missed
Load missed event-related positions
Diffstat (limited to 'web')
-rw-r--r--web/app/view/EventsController.js20
1 files changed, 18 insertions, 2 deletions
diff --git a/web/app/view/EventsController.js b/web/app/view/EventsController.js
index f2fef88..62af967 100644
--- a/web/app/view/EventsController.js
+++ b/web/app/view/EventsController.js
@@ -84,12 +84,28 @@ Ext.define('Traccar.view.EventsController', {
},
onSelectionChange: function (selection, selected) {
- var event, positionId;
+ var event, positionId, position;
event = selected.length > 0 ? selected[0] : null;
if (event) {
positionId = event.get('positionId');
if (positionId) {
- this.fireEvent('selectevent', Ext.getStore('EventPositions').getById(positionId));
+ position = Ext.getStore('EventPositions').getById(positionId);
+ if (position) {
+ this.fireEvent('selectevent', position);
+ } else {
+ Ext.getStore('EventPositions').load({
+ params: {
+ id: positionId
+ },
+ scope: this,
+ addRecords: true,
+ callback: function (records, operation, success) {
+ if (success && records.length > 0) {
+ this.fireEvent('selectevent', records[0]);
+ }
+ }
+ });
+ }
} else {
this.fireEvent('selectevent');
}