aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/AttributesAliasesController.js
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-09-27 09:52:42 +0500
committerAbyss777 <abyss@fox5.ru>2016-09-27 09:52:42 +0500
commitac4f0adf3b196b1a9af40be64b3e4e0fac91c1d6 (patch)
tree491df27460d6d3e994614b73d1e39913d9fbc8d5 /web/app/view/AttributesAliasesController.js
parent6a1a261466fae6a6718cd3c0cb43b6061ec86fba (diff)
downloadetbsa-traccar-web-ac4f0adf3b196b1a9af40be64b3e4e0fac91c1d6.tar.gz
etbsa-traccar-web-ac4f0adf3b196b1a9af40be64b3e4e0fac91c1d6.tar.bz2
etbsa-traccar-web-ac4f0adf3b196b1a9af40be64b3e4e0fac91c1d6.zip
Remove second store
Diffstat (limited to 'web/app/view/AttributesAliasesController.js')
-rw-r--r--web/app/view/AttributesAliasesController.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/web/app/view/AttributesAliasesController.js b/web/app/view/AttributesAliasesController.js
index cda3e33..8f406c4 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);
}
}
});