aboutsummaryrefslogtreecommitdiff
path: root/web/app/view
diff options
context:
space:
mode:
Diffstat (limited to 'web/app/view')
-rw-r--r--web/app/view/AttributesAliases.js2
-rw-r--r--web/app/view/AttributesAliasesController.js12
-rw-r--r--web/app/view/StateController.js13
3 files changed, 9 insertions, 18 deletions
diff --git a/web/app/view/AttributesAliases.js b/web/app/view/AttributesAliases.js
index 717991dd..8fcf10bb 100644
--- a/web/app/view/AttributesAliases.js
+++ b/web/app/view/AttributesAliases.js
@@ -26,7 +26,7 @@ Ext.define('Traccar.view.AttributesAliases', {
],
controller: 'attributesAliases',
- store: 'AttributeAliases',
+ store: 'AllAttributeAliases',
selType: 'rowmodel',
diff --git a/web/app/view/AttributesAliasesController.js b/web/app/view/AttributesAliasesController.js
index cda3e338..8f406c42 100644
--- a/web/app/view/AttributesAliasesController.js
+++ b/web/app/view/AttributesAliasesController.js
@@ -31,7 +31,7 @@ Ext.define('Traccar.view.AttributesAliasesController', {
this.lookupReference('toolbarAddButton').setDisabled(true);
this.lookupReference('toolbarEditButton').setDisabled(true);
this.lookupReference('toolbarRemoveButton').setDisabled(true);
- this.getView().getStore().loadData([], false);
+ this.getView().getStore().filter('deviceId', 0);
},
onAddClick: function () {
@@ -83,12 +83,16 @@ Ext.define('Traccar.view.AttributesAliasesController', {
},
onDeviceChange: function (combobox, newValue, oldValue) {
+ var admin = Traccar.app.getUser().get('admin');
this.onSelectionChange('');
if (newValue !== null) {
- this.getView().getStore().getProxy().setExtraParam('deviceId', newValue);
- this.getView().getStore().load();
+ this.getView().getStore().filter('deviceId', newValue);
+ if (admin && this.getView().getStore().getCount() === 0) {
+ this.getView().getStore().getProxy().setExtraParam('deviceId', newValue);
+ this.getView().getStore().load();
+ }
} else {
- this.getView().getStore().loadData([], false);
+ this.getView().getStore().filter('deviceId', 0);
}
}
});
diff --git a/web/app/view/StateController.js b/web/app/view/StateController.js
index 7462fcc8..c0f5b9a1 100644
--- a/web/app/view/StateController.js
+++ b/web/app/view/StateController.js
@@ -47,10 +47,6 @@ Ext.define('Traccar.view.StateController', {
'#AllAttributeAliases': {
add: 'updateAliases',
update: 'updateAliases'
- },
- '#AttributeAliases': {
- add: 'updateAliasesRemote',
- update: 'updateAliasesRemote'
}
}
}
@@ -183,14 +179,5 @@ Ext.define('Traccar.view.StateController', {
if (this.position !== null) {
this.updatePosition();
}
- },
-
- updateAliasesRemote: function () {
- Ext.getStore('AllAttributeAliases').load({
- scope: this,
- callback: function () {
- this.updateAliases();
- }
- });
}
});