From a193759f2a38a6b32cb1a0819ef0c687b7b52071 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Thu, 1 Sep 2016 15:22:31 +0500 Subject: Fix find index in BasePermissionsController.js --- web/app/view/BasePermissionsController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'web/app/view') diff --git a/web/app/view/BasePermissionsController.js b/web/app/view/BasePermissionsController.js index 3cdc2e4dc..5aa261c63 100644 --- a/web/app/view/BasePermissionsController.js +++ b/web/app/view/BasePermissionsController.js @@ -36,7 +36,7 @@ Ext.define('Traccar.view.BasePermissionsController', { var i, index; if (success) { for (i = 0; i < records.length; i++) { - index = this.getView().getStore().find('id', records[i].getData().id); + index = this.getView().getStore().findExact('id', records[i].getData().id); this.getView().getSelectionModel().select(index, true, true); } } -- cgit v1.2.3 From 65bb228fd2dff0993ef4d8817175bdb96c854e1f Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Thu, 1 Sep 2016 16:05:15 +0500 Subject: Replace all getData().* on getId() and get() --- web/app/controller/Root.js | 2 +- web/app/view/BasePermissionsController.js | 6 +++--- web/app/view/DevicesController.js | 2 +- web/app/view/GroupsController.js | 2 +- web/app/view/NotificationsController.js | 10 +++++----- web/app/view/UsersController.js | 6 +++--- 6 files changed, 14 insertions(+), 14 deletions(-) (limited to 'web/app/view') diff --git a/web/app/controller/Root.js b/web/app/controller/Root.js index dc759a08b..26f2f6f29 100644 --- a/web/app/controller/Root.js +++ b/web/app/controller/Root.js @@ -190,7 +190,7 @@ Ext.define('Traccar.controller.Root', { if (array[i].geofenceId !== 0) { geofence = Ext.getStore('Geofences').getById(array[i].geofenceId); if (typeof geofence !== 'undefined') { - text += ' \"' + geofence.getData().name + '"'; + text += ' \"' + geofence.get('name') + '"'; } } device = Ext.getStore('Devices').getById(array[i].deviceId); diff --git a/web/app/view/BasePermissionsController.js b/web/app/view/BasePermissionsController.js index 5aa261c63..ea0efa901 100644 --- a/web/app/view/BasePermissionsController.js +++ b/web/app/view/BasePermissionsController.js @@ -36,7 +36,7 @@ Ext.define('Traccar.view.BasePermissionsController', { var i, index; if (success) { for (i = 0; i < records.length; i++) { - index = this.getView().getStore().findExact('id', records[i].getData().id); + index = this.getView().getStore().getById(records[i].getId()); this.getView().getSelectionModel().select(index, true, true); } } @@ -49,7 +49,7 @@ Ext.define('Traccar.view.BasePermissionsController', { onBeforeSelect: function (object, record, index) { var data = {}; data[this.getView().baseObjectName] = this.getView().baseObject; - data[this.getView().linkObjectName] = record.getData().id; + data[this.getView().linkObjectName] = record.getId(); Ext.Ajax.request({ scope: this, url: this.getView().urlApi, @@ -65,7 +65,7 @@ Ext.define('Traccar.view.BasePermissionsController', { onBeforeDeselect: function (object, record, index) { var data = {}; data[this.getView().baseObjectName] = this.getView().baseObject; - data[this.getView().linkObjectName] = record.getData().id; + data[this.getView().linkObjectName] = record.getId(); Ext.Ajax.request({ scope: this, method: 'DELETE', diff --git a/web/app/view/DevicesController.js b/web/app/view/DevicesController.js index 17f98629f..6dcc45448 100644 --- a/web/app/view/DevicesController.js +++ b/web/app/view/DevicesController.js @@ -99,7 +99,7 @@ Ext.define('Traccar.view.DevicesController', { linkObjectName: 'geofenceId', storeName: 'Geofences', urlApi: 'api/devices/geofences', - baseObject: device.getData().id + baseObject: device.getId() } }).show(); }, diff --git a/web/app/view/GroupsController.js b/web/app/view/GroupsController.js index f1d6e53f3..06057fda0 100644 --- a/web/app/view/GroupsController.js +++ b/web/app/view/GroupsController.js @@ -74,7 +74,7 @@ Ext.define('Traccar.view.GroupsController', { linkObjectName: 'geofenceId', storeName: admin ? 'AllGeofences' : 'Geofences', urlApi: 'api/groups/geofences', - baseObject: group.getData().id + baseObject: group.getId() } }).show(); }, diff --git a/web/app/view/NotificationsController.js b/web/app/view/NotificationsController.js index d880c5d41..4e041eb99 100644 --- a/web/app/view/NotificationsController.js +++ b/web/app/view/NotificationsController.js @@ -23,7 +23,7 @@ Ext.define('Traccar.view.NotificationsController', { ], init: function () { - this.userId = this.getView().user.getData().id; + this.userId = this.getView().user.getId(); this.getView().getStore().load({ scope: this, callback: function (records, operation, success) { @@ -37,8 +37,8 @@ Ext.define('Traccar.view.NotificationsController', { var i, index, attributes, storeRecord; if (success) { for (i = 0; i < records.length; i++) { - index = this.getView().getStore().find('type', records[i].getData().type); - attributes = records[i].getData().attributes; + index = this.getView().getStore().findExact('type', records[i].get('type')); + attributes = records[i].get('attributes'); storeRecord = this.getView().getStore().getAt(index); storeRecord.set('attributes', attributes); storeRecord.commit(); @@ -71,8 +71,8 @@ Ext.define('Traccar.view.NotificationsController', { url: 'api/users/notifications', jsonData: { userId: this.userId, - type: record.getData().type, - attributes: record.getData().attributes + type: record.get('type'), + attributes: record.get('attributes') }, callback: function (options, success, response) { if (!success) { diff --git a/web/app/view/UsersController.js b/web/app/view/UsersController.js index da7dd8f13..fad5f245e 100644 --- a/web/app/view/UsersController.js +++ b/web/app/view/UsersController.js @@ -79,7 +79,7 @@ Ext.define('Traccar.view.UsersController', { storeName: 'AllDevices', linkStoreName: 'Devices', urlApi: 'api/permissions/devices', - baseObject: user.getData().id + baseObject: user.getId() } }).show(); }, @@ -95,7 +95,7 @@ Ext.define('Traccar.view.UsersController', { storeName: 'AllGroups', linkStoreName: 'Groups', urlApi: 'api/permissions/groups', - baseObject: user.getData().id + baseObject: user.getId() } }).show(); }, @@ -111,7 +111,7 @@ Ext.define('Traccar.view.UsersController', { storeName: 'AllGeofences', linkStoreName: 'Geofences', urlApi: 'api/permissions/geofences', - baseObject: user.getData().id + baseObject: user.getId() } }).show(); }, -- cgit v1.2.3