diff options
author | Abyss777 <abyss@fox5.ru> | 2016-08-30 09:02:21 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2016-08-30 09:02:21 +0500 |
commit | a09d2276f093504f8ab07bfadf0fbb3854ce5292 (patch) | |
tree | dc7aeb531740598e929af48b56404c477b9d4da8 /web/app/view/ReportController.js | |
parent | 9829184c5f941fd32d9d6c351dbdd113f00d352d (diff) | |
download | trackermap-server-a09d2276f093504f8ab07bfadf0fbb3854ce5292.tar.gz trackermap-server-a09d2276f093504f8ab07bfadf0fbb3854ce5292.tar.bz2 trackermap-server-a09d2276f093504f8ab07bfadf0fbb3854ce5292.zip |
Disable buttons if report not configured
Diffstat (limited to 'web/app/view/ReportController.js')
-rw-r--r-- | web/app/view/ReportController.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/web/app/view/ReportController.js b/web/app/view/ReportController.js index 0247c96a9..6f998396c 100644 --- a/web/app/view/ReportController.js +++ b/web/app/view/ReportController.js @@ -60,6 +60,15 @@ Ext.define('Traccar.view.ReportController', { dialog.show(); }, + updateButtons: function () { + var reportType, disabled, devices; + reportType = this.lookupReference('reportTypeField').getValue(); + devices = this.deviceId && this.deviceId.length !== 0 || this.groupId && this.groupId.length !== 0; + disabled = !reportType || !devices; + this.lookupReference('showButton').setDisabled(disabled); + this.lookupReference('csvButton').setDisabled(disabled); + }, + onReportClick: function (button) { var reportType, from, to, store, url; @@ -324,6 +333,8 @@ Ext.define('Traccar.view.ReportController', { } else if (newValue === 'trips') { this.getView().reconfigure('ReportTrips', tripsColumns); } + + this.updateButtons(); } }); |