From 93cb08d9d0cc94ccc37b6a1adf0d14d10c72e801 Mon Sep 17 00:00:00 2001 From: slqgsm Date: Fri, 29 Jul 2016 16:30:38 +0000 Subject: [PATCH] fixed typo and issue of not being able to add fields in table transformation --- public/app/plugins/panel/table/module.ts | 1 + public/app/plugins/panel/table/transformers.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/public/app/plugins/panel/table/module.ts b/public/app/plugins/panel/table/module.ts index 86847a01aac..e4ddf67e23d 100644 --- a/public/app/plugins/panel/table/module.ts +++ b/public/app/plugins/panel/table/module.ts @@ -94,6 +94,7 @@ class TablePanelCtrl extends MetricsPanelCtrl { onDataReceived(dataList) { this.dataRaw = dataList; this.pageIndex = 0; + this.panel.columns = []; // automatically correct transform mode based on data if (this.dataRaw && this.dataRaw.length) { diff --git a/public/app/plugins/panel/table/transformers.ts b/public/app/plugins/panel/table/transformers.ts index 1e3ccec6e1c..53e19823d0b 100644 --- a/public/app/plugins/panel/table/transformers.ts +++ b/public/app/plugins/panel/table/transformers.ts @@ -142,7 +142,7 @@ transformers['table'] = { if (!data || data.length === 0) { return []; } - return data[0] + return data[0].columns; }, transform: function(data, panel, model) { if (!data || data.length === 0) {