aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/BasePermissionsController.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/view/BasePermissionsController.js')
-rw-r--r--web/app/view/BasePermissionsController.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/web/app/view/BasePermissionsController.js b/web/app/view/BasePermissionsController.js
index e18badcc..2fb2d873 100644
--- a/web/app/view/BasePermissionsController.js
+++ b/web/app/view/BasePermissionsController.js
@@ -47,7 +47,7 @@ Ext.define('Traccar.view.BasePermissionsController', {
});
},
- onBeforeSelect: function (object, record, index) {
+ onBeforeSelect: function (selection, record, index) {
var data = {};
data[this.getView().baseObjectName] = this.getView().baseObject;
data[this.getView().linkObjectName] = record.getId();
@@ -57,13 +57,14 @@ Ext.define('Traccar.view.BasePermissionsController', {
jsonData: Ext.util.JSON.encode(data),
callback: function (options, success, response) {
if (!success) {
+ selection.deselect(record);
Traccar.app.showError(response);
}
}
});
},
- onBeforeDeselect: function (object, record, index) {
+ onBeforeDeselect: function (selection, record, index) {
var data = {};
data[this.getView().baseObjectName] = this.getView().baseObject;
data[this.getView().linkObjectName] = record.getId();
@@ -74,6 +75,7 @@ Ext.define('Traccar.view.BasePermissionsController', {
jsonData: Ext.util.JSON.encode(data),
callback: function (options, success, response) {
if (!success) {
+ selection.select(record);
Traccar.app.showError(response);
}
}