diff options
author | Abyss777 <abyss@fox5.ru> | 2017-03-08 09:06:46 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-03-08 09:06:46 +0500 |
commit | f30f6961890371e026cd548874a31292e2de3c21 (patch) | |
tree | e8649620a02d050b1c2e907212ae2a0ef2cfd041 /web/app | |
parent | 7db1c1cdcf617e146e927c4aadde239959a9d3de (diff) | |
download | trackermap-web-f30f6961890371e026cd548874a31292e2de3c21.tar.gz trackermap-web-f30f6961890371e026cd548874a31292e2de3c21.tar.bz2 trackermap-web-f30f6961890371e026cd548874a31292e2de3c21.zip |
Organize onCommandClick function
Diffstat (limited to 'web/app')
-rw-r--r-- | web/app/view/DevicesController.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/web/app/view/DevicesController.js b/web/app/view/DevicesController.js index d65055e7..742077b2 100644 --- a/web/app/view/DevicesController.js +++ b/web/app/view/DevicesController.js @@ -74,16 +74,20 @@ Ext.define('Traccar.view.DevicesController', { }, onCommandClick: function () { - var device, deviceId, command, dialog, comboStore, online; + var device, deviceId, command, dialog, typesStore, online; device = this.getView().getSelectionModel().getSelection()[0]; online = device.get('status') === 'online'; deviceId = device.get('id'); + command = Ext.create('Traccar.model.Command'); command.set('deviceId', deviceId); command.set('textChannel', !online); + dialog = Ext.create('Traccar.view.CommandDialog'); - comboStore = dialog.down('form').down('combobox').getStore(); - comboStore.getProxy().setExtraParam('deviceId', deviceId); + + typesStore = dialog.lookupReference('commandType').getStore(); + typesStore.getProxy().setExtraParam('deviceId', deviceId); + dialog.down('form').loadRecord(command); dialog.lookupReference('textChannelCheckBox').setDisabled(!online); dialog.show(); |