diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/app/view/Devices.js | 16 | ||||
-rw-r--r-- | web/l10n/en.json | 1 |
2 files changed, 16 insertions, 1 deletions
diff --git a/web/app/view/Devices.js b/web/app/view/Devices.js index 3dd81eb05..ae46ba080 100644 --- a/web/app/view/Devices.js +++ b/web/app/view/Devices.js @@ -29,13 +29,27 @@ Ext.define('Traccar.view.Devices', { initComponent: function() { this.store = Ext.create('Ext.data.ChainedStore', { - source: 'Devices' + source: 'Devices', + groupField: 'groupId' }); this.callParent(); }, title: Strings.deviceTitle, selType: 'rowmodel', + features: [{ + ftype: 'grouping', + groupHeaderTpl: Ext.create('Ext.XTemplate', '{name:this.getGroupName}', { + getGroupName: function (v) { + var groupId = Number(v); + if (groupId) { + return Ext.getStore('Groups').getById(groupId).get('name'); + } else { + return Strings.groupNoGroup; + } + } + }) + }], tbar: { xtype: 'editToolbar', diff --git a/web/l10n/en.json b/web/l10n/en.json index 141ea5b96..1c8cc2bd0 100644 --- a/web/l10n/en.json +++ b/web/l10n/en.json @@ -38,6 +38,7 @@ "deviceFollow": "Follow", "groupDialog": "Group", "groupParent": "Group", + "groupNoGroup": "No Group", "settingsTitle": "Settings", "settingsUser": "Account", "settingsGroups": "Groups", |