diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-06-12 18:47:39 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-06-12 18:47:39 +1200 |
commit | 4ddc9fbd11395760dc69c04cb806ba173676f56c (patch) | |
tree | 422828cd52f771faa9c7ab6c7cb3a9fa7bf832d3 /web/app/view/state/StateController.js | |
parent | ff1b03e46767d92432827f3bad8e6b0e124dd33a (diff) | |
download | trackermap-server-4ddc9fbd11395760dc69c04cb806ba173676f56c.tar.gz trackermap-server-4ddc9fbd11395760dc69c04cb806ba173676f56c.tar.bz2 trackermap-server-4ddc9fbd11395760dc69c04cb806ba173676f56c.zip |
Populate state with dummy data
Diffstat (limited to 'web/app/view/state/StateController.js')
-rw-r--r-- | web/app/view/state/StateController.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/web/app/view/state/StateController.js b/web/app/view/state/StateController.js index 8050bcb88..be9e1a15b 100644 --- a/web/app/view/state/StateController.js +++ b/web/app/view/state/StateController.js @@ -18,7 +18,45 @@ Ext.define('Traccar.view.state.StateController', { extend: 'Ext.app.ViewController', alias: 'controller.state', + config: { + listen: { + controller: { + '*': { + selectDevice: 'selectDevice' + } + } + } + }, + init: function() { + }, + + selectDevice: function(device) { + var position = { + "fixTime":"2012-01-02T01:50:00", + "longitude":130.0, + "latitude":60.0, + "valid":true, + "altitude":0.0, + "speed":0.0, + "course":0.0, + "deviceId":1, + "other":"<info><status>84-20</status></info>", + "deviceTime":"2012-01-02T01:50:00", + "id":29, + "protocol":"gotop" + }; + + var store = Ext.getStore('Parameters'); + + for (var key in position) { + if (position.hasOwnProperty(key) && key !== 'other') { + store.add(Ext.create('Traccar.model.Parameter', { + name: key, + value: position[key] + })); + } + } } }); |