diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-03-30 22:03:21 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-30 22:03:21 +1300 |
commit | 60ce363e8be05b969577ca983ce1b6c456546caf (patch) | |
tree | 44e3b31a1b87dde36bc6c7962970307d692c8dcd | |
parent | 0a35d3a7c4aa2968e2b8d4b73cfbd486c9fc625b (diff) | |
parent | 66ce291cf7782db242ac61a3a4617386cb472744 (diff) | |
download | trackermap-web-60ce363e8be05b969577ca983ce1b6c456546caf.tar.gz trackermap-web-60ce363e8be05b969577ca983ce1b6c456546caf.tar.bz2 trackermap-web-60ce363e8be05b969577ca983ce1b6c456546caf.zip |
Merge pull request #458 from Abyss777/color_device_row
Set device status color for whole row
-rw-r--r-- | web/app/view/edit/Devices.js | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/web/app/view/edit/Devices.js b/web/app/view/edit/Devices.js index 42291f0b..7c1f9358 100644 --- a/web/app/view/edit/Devices.js +++ b/web/app/view/edit/Devices.js @@ -88,6 +88,15 @@ Ext.define('Traccar.view.edit.Devices', { selectionchange: 'onSelectionChange' }, + viewConfig: { + getRowClass: function (record) { + var status = record.get('status'); + if (status) { + return Ext.getStore('DeviceStatuses').getById(status).get('color'); + } + } + }, + columns: { defaults: { flex: 1, @@ -142,7 +151,6 @@ Ext.define('Traccar.view.edit.Devices', { if (value) { status = Ext.getStore('DeviceStatuses').getById(value); if (status) { - metaData.tdCls = status.get('color'); return status.get('name'); } } @@ -151,12 +159,7 @@ Ext.define('Traccar.view.edit.Devices', { text: Strings.deviceLastUpdate, dataIndex: 'lastUpdate', renderer: function (value, metaData, record) { - var status, seconds, interval; - - status = record.get('status'); - if (status) { - metaData.tdCls = Ext.getStore('DeviceStatuses').getById(status).get('color'); - } + var seconds, interval; if (value) { seconds = Math.floor((new Date() - value) / 1000); |