diff options
author | Abyss777 <abyss@fox5.ru> | 2017-08-10 10:03:57 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-08-10 10:03:57 +0500 |
commit | fc63eb7db5f98d707d63fe82989ab235759fbb29 (patch) | |
tree | 26e55e931c4e22706fd5ad930789b791e6790647 /web/app | |
parent | 1873fc05dfa0532d1ca665bd3d32ce5cb1d8d040 (diff) | |
download | trackermap-web-fc63eb7db5f98d707d63fe82989ab235759fbb29.tar.gz trackermap-web-fc63eb7db5f98d707d63fe82989ab235759fbb29.tar.bz2 trackermap-web-fc63eb7db5f98d707d63fe82989ab235759fbb29.zip |
Load missed Event related positions
Diffstat (limited to 'web/app')
-rw-r--r-- | web/app/view/EventsController.js | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/web/app/view/EventsController.js b/web/app/view/EventsController.js index f2fef887..62af967b 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'); } |