diff options
author | Abyss777 <abyss@fox5.ru> | 2018-06-26 12:00:15 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2018-06-26 13:55:11 +0500 |
commit | 17157262fef1c046d116b2270f4e1d335fe9da1b (patch) | |
tree | 751583dde65b666e4ab249b26010b7bec6f279b6 /web/app/AttributeFormatter.js | |
parent | d67213556dcc87453c0ad5cd6f9e8851c477a2f3 (diff) | |
download | trackermap-web-17157262fef1c046d116b2270f4e1d335fe9da1b.tar.gz trackermap-web-17157262fef1c046d116b2270f4e1d335fe9da1b.tar.bz2 trackermap-web-17157262fef1c046d116b2270f4e1d335fe9da1b.zip |
Implement refactored notifications
Diffstat (limited to 'web/app/AttributeFormatter.js')
-rw-r--r-- | web/app/AttributeFormatter.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/web/app/AttributeFormatter.js b/web/app/AttributeFormatter.js index b2286249..c2793827 100644 --- a/web/app/AttributeFormatter.js +++ b/web/app/AttributeFormatter.js @@ -73,7 +73,16 @@ Ext.define('Traccar.AttributeFormatter', { }, deviceIdFormatter: function (value) { - return Ext.getStore('Devices').getById(value).get('name'); + var device, store; + if (value !== 0) { + store = Ext.getStore('AllDevices'); + if (store.getTotalCount() === 0) { + store = Ext.getStore('Devices'); + } + device = store.getById(value); + return device ? device.get('name') : ''; + } + return null; }, groupIdFormatter: function (value) { |