From fb10eae09daf7e922ee5e2d94785d55b8b5f6b4b Mon Sep 17 00:00:00 2001 From: Ashutosh Bishnoi Date: Tue, 23 Mar 2021 11:40:31 +0530 Subject: More code refactoring --- modern/src/reports/RouteReportPage.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modern/src/reports/RouteReportPage.js b/modern/src/reports/RouteReportPage.js index e556a0ba..1c13a132 100644 --- a/modern/src/reports/RouteReportPage.js +++ b/modern/src/reports/RouteReportPage.js @@ -64,14 +64,16 @@ const RouteReportPage = () => { field: 'ignition', type: 'boolean', flex: 1, - valueGetter: ({ getValue }) => getValue('attributes').ignition ? 'Yes' : 'No', + valueGetter: ({ row }) => row.attributes.ignition, + valueFormatter: ({ value }) => value ? 'Yes' : 'No', }, { headerName: t('deviceTotalDistance'), field: 'totalDistance', type: 'number', hide: true, flex: 1, - valueGetter: ({ getValue }) => formatDistance(getValue('attributes').totalDistance, distanceUnit), + valueGetter: ({ row }) => row.attributes.totalDistance, + valueFormatter: ({ value }) => formatDistance(value, distanceUnit), }] const [items, setItems] = useState([]); -- cgit v1.2.3