aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/Devices.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-04-12 20:52:36 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2016-04-12 20:53:09 +1200
commit75ed21f2e12c02bc7a7231e3345c757d04693abb (patch)
treefffb0ba99221fb318ed751b370958560e6d7e7ce /web/app/view/Devices.js
parentccd8cce3f0bfb06027a4185836f1c1f72fc234fb (diff)
downloadtrackermap-server-75ed21f2e12c02bc7a7231e3345c757d04693abb.tar.gz
trackermap-server-75ed21f2e12c02bc7a7231e3345c757d04693abb.tar.bz2
trackermap-server-75ed21f2e12c02bc7a7231e3345c757d04693abb.zip
Implement device groupping in grid
Diffstat (limited to 'web/app/view/Devices.js')
-rw-r--r--web/app/view/Devices.js16
1 files changed, 15 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',