From e8c2e5cca626b0d441ae004ec4da7c29c6e73fb9 Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Fri, 26 Oct 2018 02:28:08 +0530 Subject: [PATCH] Make reportColumns a method --- ui/pages/Report/index.vue | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/ui/pages/Report/index.vue b/ui/pages/Report/index.vue index e767b6c7..4efd0877 100644 --- a/ui/pages/Report/index.vue +++ b/ui/pages/Report/index.vue @@ -18,11 +18,6 @@ export default { name: 'Report', props: ['reportName', 'reportConfig', 'filters'], computed: { - reportColumns() { - return utils.convertFieldsToDatatableColumns( - this.reportConfig.getColumns() - ); - }, filtersExists() { return (this.reportConfig.filterFields || []).length; } @@ -42,7 +37,7 @@ export default { } if (data.columns) { - columns = data.columns; + columns = this.getColumns(data); } if (!rows) { @@ -50,7 +45,7 @@ export default { } if (!columns) { - columns = this.reportColumns; + columns = this.getColumns(); } for(let column of columns) { @@ -65,6 +60,10 @@ export default { data: rows }); } + }, + getColumns(data) { + const columns = this.reportConfig.getColumns(data); + return utils.convertFieldsToDatatableColumns(columns); } }, components: {