From 8063c5e93514475daba2caf6538e261f27681bc3 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 25 Jul 2015 21:26:07 +1200 Subject: Add send command dialog --- web/app/view/device/DeviceController.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'web/app/view/device/DeviceController.js') diff --git a/web/app/view/device/DeviceController.js b/web/app/view/device/DeviceController.js index 794e0f03d..f5577f156 100644 --- a/web/app/view/device/DeviceController.js +++ b/web/app/view/device/DeviceController.js @@ -20,6 +20,7 @@ Ext.define('Traccar.view.device.DeviceController', { requires: [ 'Traccar.view.device.DeviceDialog', + 'Traccar.view.command.CommandDialog', 'Traccar.view.user.UserDialog', 'Traccar.view.admin.ServerDialog', 'Traccar.view.user.User' @@ -82,9 +83,13 @@ Ext.define('Traccar.view.device.DeviceController', { onCommandClick: function() { var device = this.getView().getSelectionModel().getSelection()[0]; - console.log('send command here'); + var command = Ext.create('Traccar.model.Command'); + command.set('deviceId', device.get('id')); + var dialog = Ext.create('Traccar.view.command.CommandDialog'); + dialog.down('form').loadRecord(command); + dialog.show(); }, - + onSelectionChange: function(selected) { var empty = selected.getCount() === 0; this.lookupReference('deviceEditButton').setDisabled(empty); -- cgit v1.2.3