diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-06-07 18:29:19 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-06-07 18:29:19 +1200 |
commit | 38ea2292b1650c6cdfdce5096ab7258dcd8cb29b (patch) | |
tree | d4b902547c9951d1af0caf37c75e1f97aa9c98ce /web/app/view/device | |
parent | 4a91ebb7535b8e199b8c9cce041757eeedd350ce (diff) | |
download | trackermap-server-38ea2292b1650c6cdfdce5096ab7258dcd8cb29b.tar.gz trackermap-server-38ea2292b1650c6cdfdce5096ab7258dcd8cb29b.tar.bz2 trackermap-server-38ea2292b1650c6cdfdce5096ab7258dcd8cb29b.zip |
Add row selection events
Diffstat (limited to 'web/app/view/device')
-rw-r--r-- | web/app/view/device/DeviceController.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/web/app/view/device/DeviceController.js b/web/app/view/device/DeviceController.js index f45f348b6..158f6c52c 100644 --- a/web/app/view/device/DeviceController.js +++ b/web/app/view/device/DeviceController.js @@ -71,9 +71,12 @@ Ext.define('Traccar.view.device.DeviceController', { }, onSelectionChange: function(selected) { - var disabled = selected.length > 0; - this.lookupReference('deviceEditButton').setDisabled(disabled); - this.lookupReference('deviceRemoveButton').setDisabled(disabled); + var empty = selected.getCount() === 0; + this.lookupReference('deviceEditButton').setDisabled(empty); + this.lookupReference('deviceRemoveButton').setDisabled(empty); + if (!empty) { + this.fireEvent("selectDevice", selected.getLastSelected()); + } }, onUserClick: function() { |