diff options
author | Abyss777 <abyss@fox5.ru> | 2017-03-18 10:22:17 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-03-18 10:22:17 +0500 |
commit | 61590f09ba735a532ff337ea841c8f4d27bd81e3 (patch) | |
tree | 0b88aa56e842ba152a35158b6caabe982a2c9563 /web/app/controller | |
parent | fd2207b15d98d8fdef306f3b94924a759c80a3d9 (diff) | |
download | trackermap-web-61590f09ba735a532ff337ea841c8f4d27bd81e3.tar.gz trackermap-web-61590f09ba735a532ff337ea841c8f4d27bd81e3.tar.bz2 trackermap-web-61590f09ba735a532ff337ea841c8f4d27bd81e3.zip |
Initialize stores on application load
Diffstat (limited to 'web/app/controller')
-rw-r--r-- | web/app/controller/Root.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js index b6e5f385..950b3348 100644 --- a/web/app/controller/Root.js +++ b/web/app/controller/Root.js @@ -78,7 +78,9 @@ Ext.define('Traccar.controller.Root', { var attribution, eventId; Ext.getStore('Groups').load(); Ext.getStore('Geofences').load(); + Ext.getStore('Calendars').load(); Ext.getStore('AttributeAliases').load(); + this.initReportEventTypesStore(); Ext.getStore('Devices').load({ scope: this, callback: function () { @@ -239,5 +241,25 @@ Ext.define('Traccar.controller.Root', { if (lat === 0 && lon === 0 && zoom === 0) { this.fireEvent('zoomtoalldevices'); } + }, + + initReportEventTypesStore: function () { + var store = Ext.getStore('ReportEventTypes'); + store.add({ + type: Traccar.store.ReportEventTypes.allEvents, + name: Strings.eventAll + }); + Ext.create('Traccar.store.AllNotifications').load({ + scope: this, + callback: function (records, operation, success) { + var i, value; + if (success) { + for (i = 0; i < records.length; i++) { + value = records[i].get('type'); + store.add({type: value, name: Traccar.app.getEventString(value)}); + } + } + } + }); } }); |