diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-06-19 23:45:00 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-19 23:45:00 +1200 |
commit | 5a6044faac45b377efabe363655ec21790bd955b (patch) | |
tree | e5d60feb3a6d17775c4b63379920d9ff88aaa379 /web/app/AttributeFormatter.js | |
parent | f3ce72afbd49ccde94178158147de7b378128a55 (diff) | |
parent | 56a5de3dc50e438884c5636c11f31e48bf19a15e (diff) | |
download | trackermap-web-5a6044faac45b377efabe363655ec21790bd955b.tar.gz trackermap-web-5a6044faac45b377efabe363655ec21790bd955b.tar.bz2 trackermap-web-5a6044faac45b377efabe363655ec21790bd955b.zip |
Merge pull request #507 from Abyss777/column_filters
Column filters to most windows
Diffstat (limited to 'web/app/AttributeFormatter.js')
-rw-r--r-- | web/app/AttributeFormatter.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/web/app/AttributeFormatter.js b/web/app/AttributeFormatter.js index aecbd8a2..0c385672 100644 --- a/web/app/AttributeFormatter.js +++ b/web/app/AttributeFormatter.js @@ -62,6 +62,18 @@ Ext.define('Traccar.AttributeFormatter', { return Ext.getStore('Devices').getById(value).get('name'); }, + groupIdFormatter: function (value) { + var group, store; + if (value !== 0) { + store = Ext.getStore('AllGroups'); + if (store.getTotalCount() === 0) { + store = Ext.getStore('Groups'); + } + group = store.getById(value); + return group ? group.get('name') : value; + } + }, + lastUpdateFormatter: function (value) { var seconds, interval; @@ -113,6 +125,8 @@ Ext.define('Traccar.AttributeFormatter', { return this.durationFormatter; } else if (key === 'deviceId') { return this.deviceIdFormatter; + } else if (key === 'groupId') { + return this.groupIdFormatter; } else if (key === 'lastUpdate') { return this.lastUpdateFormatter; } else { |