Commit d11b17b8 by Carl Bergquist Committed by GitHub

Merge pull request #5677 from bmundt/remove_columns

Added Hidden Column Style for Table Panel
parents 4543bfe5 e17b1548
......@@ -39,6 +39,7 @@ export class TablePanelEditorCtrl {
{text: 'Number', value: 'number'},
{text: 'String', value: 'string'},
{text: 'Date', value: 'date'},
{text: 'Hidden', value: 'hidden'}
];
this.fontSizes = ['80%', '90%', '100%', '110%', '120%', '130%', '150%', '160%', '180%', '200%', '220%', '250%'];
this.dateFormats = [
......
......@@ -4,7 +4,7 @@
<table class="table-panel-table">
<thead>
<tr>
<th ng-repeat="col in ctrl.table.columns">
<th ng-repeat="col in ctrl.table.columns" ng-hide="col.hidden">
<div class="table-panel-table-header-inner pointer" ng-click="ctrl.toggleColumnSort(col, $index)">
{{col.text}}
<span class="table-panel-table-header-controls" ng-if="col.sort">
......
......@@ -45,6 +45,12 @@ export class TableRenderer {
return this.defaultCellFormater;
}
if (style.type === 'hidden') {
return v => {
return undefined;
};
}
if (style.type === 'date') {
return v => {
if (v === undefined || v === null) {
......@@ -123,6 +129,13 @@ export class TableRenderer {
widthHack = '<div class="table-panel-width-hack">' + this.table.columns[columnIndex].text + '</div>';
}
if (value === undefined) {
style = ' style="display:none;"';
this.table.columns[columnIndex].hidden = true;
} else {
this.table.columns[columnIndex].hidden = false;
}
return '<td' + style + '>' + value + widthHack + '</td>';
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment