From 66ce291cf7782db242ac61a3a4617386cb472744 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Wed, 29 Mar 2017 17:29:46 +0500 Subject: Set device status color for whole row --- web/app/view/edit/Devices.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'web') diff --git a/web/app/view/edit/Devices.js b/web/app/view/edit/Devices.js index 42291f0..7c1f935 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); -- cgit v1.2.3