aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-03-29 17:29:46 +0500
committerAbyss777 <abyss@fox5.ru>2017-03-29 17:29:46 +0500
commit66ce291cf7782db242ac61a3a4617386cb472744 (patch)
tree44e3b31a1b87dde36bc6c7962970307d692c8dcd
parent0a35d3a7c4aa2968e2b8d4b73cfbd486c9fc625b (diff)
downloadtrackermap-web-66ce291cf7782db242ac61a3a4617386cb472744.tar.gz
trackermap-web-66ce291cf7782db242ac61a3a4617386cb472744.tar.bz2
trackermap-web-66ce291cf7782db242ac61a3a4617386cb472744.zip
Set device status color for whole row
-rw-r--r--web/app/view/edit/Devices.js17
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);