From 75ed21f2e12c02bc7a7231e3345c757d04693abb Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 12 Apr 2016 20:52:36 +1200 Subject: Implement device groupping in grid --- .../traccar/protocol/UlbotechProtocolDecoderTest.java | 3 +++ web/app/view/Devices.js | 16 +++++++++++++++- web/l10n/en.json | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java b/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java index edee9930d..244eb4540 100644 --- a/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java +++ b/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class UlbotechProtocolDecoderTest extends ProtocolTest { UlbotechProtocolDecoder decoder = new UlbotechProtocolDecoder(new UlbotechProtocol()); + verifyPosition(decoder, binary( + "f8010108683230211861161e9d8c48020b00de0063eb730128b56161030400010001040400127d0705060174179422021005e000000001db06f8")); + verifyPosition(decoder, binary( "f8010103515790566431569e5fbb9d010e015ee2b906bde4a000000000009f03040a4000000404000115fe05060340173f22030711310583410c0000310d00312f834131000008040000b78c09077320290082c021100101120af8")); 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", -- cgit v1.2.3