aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/Devices.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-11-08 12:04:28 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-11-08 12:04:28 +1300
commit11c8c039cc8c5a1948281f410bdb440d5a9f1608 (patch)
treec10465b8dc779fbc24da7e0038d555bf16d9b23e /web/app/view/Devices.js
parent0c68417e4a15051240cd724bb5f12fe0fc39c1de (diff)
downloadtrackermap-web-11c8c039cc8c5a1948281f410bdb440d5a9f1608.tar.gz
trackermap-web-11c8c039cc8c5a1948281f410bdb440d5a9f1608.tar.bz2
trackermap-web-11c8c039cc8c5a1948281f410bdb440d5a9f1608.zip
Specify min width for columns
Diffstat (limited to 'web/app/view/Devices.js')
-rw-r--r--web/app/view/Devices.js94
1 files changed, 47 insertions, 47 deletions
diff --git a/web/app/view/Devices.js b/web/app/view/Devices.js
index 19739768..1789a119 100644
--- a/web/app/view/Devices.js
+++ b/web/app/view/Devices.js
@@ -153,52 +153,52 @@ Ext.define('Traccar.view.Devices', {
selectionchange: 'onSelectionChange'
},
- columns: [{
- text: Strings.sharedName,
- dataIndex: 'name',
- flex: 1
- }, {
- text: Strings.deviceIdentifier,
- dataIndex: 'uniqueId',
- hidden: true,
- flex: 1
- }, {
- text: Strings.devicePhone,
- dataIndex: 'phone',
- hidden: true,
- flex: 1
- }, {
- text: Strings.deviceModel,
- dataIndex: 'model',
- hidden: true,
- flex: 1
- }, {
- text: Strings.deviceContact,
- dataIndex: 'contact',
- hidden: true,
- flex: 1
- }, {
- text: Strings.deviceLastUpdate,
- dataIndex: 'lastUpdate',
- flex: 1,
- renderer: function (value, metaData, record) {
- switch (record.get('status')) {
- case 'online':
- metaData.tdCls = 'view-color-green';
- break;
- case 'offline':
- metaData.tdCls = 'view-color-red';
- break;
- default:
- metaData.tdCls = 'view-color-yellow';
- break;
- }
- if (Traccar.app.getPreference('twelveHourFormat', false)) {
- return Ext.Date.format(value, Traccar.Style.dateTimeFormat12);
- } else {
- return Ext.Date.format(value, Traccar.Style.dateTimeFormat24);
- }
- }
- }]
+ forceFit: true,
+ columns: {
+ defaults: {
+ minWidth: Traccar.Style.columnWidthNormal
+ },
+ items: [{
+ text: Strings.sharedName,
+ dataIndex: 'name'
+ }, {
+ text: Strings.deviceIdentifier,
+ dataIndex: 'uniqueId',
+ hidden: true
+ }, {
+ text: Strings.devicePhone,
+ dataIndex: 'phone',
+ hidden: true
+ }, {
+ text: Strings.deviceModel,
+ dataIndex: 'model',
+ hidden: true
+ }, {
+ text: Strings.deviceContact,
+ dataIndex: 'contact',
+ hidden: true
+ }, {
+ text: Strings.deviceLastUpdate,
+ dataIndex: 'lastUpdate',
+ renderer: function (value, metaData, record) {
+ switch (record.get('status')) {
+ case 'online':
+ metaData.tdCls = 'view-color-green';
+ break;
+ case 'offline':
+ metaData.tdCls = 'view-color-red';
+ break;
+ default:
+ metaData.tdCls = 'view-color-yellow';
+ break;
+ }
+ if (Traccar.app.getPreference('twelveHourFormat', false)) {
+ return Ext.Date.format(value, Traccar.Style.dateTimeFormat12);
+ } else {
+ return Ext.Date.format(value, Traccar.Style.dateTimeFormat24);
+ }
+ }
+ }]
+ }
});