浏览代码

don't render hidden columns in table panel (#12911)

Marcus Efraimsson 7 年之前
父节点
当前提交
36e808834d
共有 2 个文件被更改,包括 5 次插入1 次删除
  1. 1 1
      public/app/plugins/panel/table/module.html
  2. 4 0
      public/app/plugins/panel/table/renderer.ts

+ 1 - 1
public/app/plugins/panel/table/module.html

@@ -5,7 +5,7 @@
 		<table class="table-panel-table">
 			<thead>
 				<tr>
-					<th ng-repeat="col in ctrl.table.columns" ng-hide="col.hidden">
+					<th ng-repeat="col in ctrl.table.columns" ng-if="!col.hidden">
 						<div class="table-panel-table-header-inner pointer" ng-click="ctrl.toggleColumnSort(col, $index)">
 							{{col.title}}
 							<span class="table-panel-table-header-controls" ng-if="col.sort">

+ 4 - 0
public/app/plugins/panel/table/renderer.ts

@@ -238,6 +238,10 @@ export class TableRenderer {
       column.hidden = false;
     }
 
+    if (column.hidden === true) {
+      return '';
+    }
+
     if (column.style && column.style.preserveFormat) {
       cellClasses.push('table-panel-cell-pre');
     }