getredash/redash#2215 Custom CSS based on column type

This commit is contained in:
Levko Kravets 2018-02-23 11:19:07 +02:00
parent c65b637bc4
commit 5dd76674ff
4 changed files with 11 additions and 4 deletions

View File

@ -1,4 +1,4 @@
<td ng-class="'content-align-' + column.alignContent">
<td ng-class="'content-align-' + column.alignContent + ' display-as-' + column.displayAs">
<div ng-if="allowHTML" ng-bind-html="value"></div>
<div ng-if="!allowHTML" ng-bind="value"></div>
</td>

View File

@ -3,8 +3,7 @@
<thead>
<tr>
<th ng-repeat="column in $ctrl.columns" ng-click="$ctrl.onColumnHeaderClick($event, column)"
class="sortable-column" ng-class="'content-align-' + column.alignContent"
width="{{ ['number', 'boolean', 'datetime', 'image'].indexOf(column.displayAs) >= 0 ? '1%' : undefined }}">
class="sortable-column" ng-class="'content-align-' + column.alignContent + ' display-as-' + column.displayAs">
<span ng-if="($ctrl.orderBy.length > 1) && ($ctrl.orderByColumnsIndex[column.name] > 0)"
class="sort-order-indicator">{{ $ctrl.orderByColumnsIndex[column.name] }}</span>
<span>{{column.title}}</span>

View File

@ -49,4 +49,12 @@
}
}
}
.display-as-number,
.display-as-boolean,
.display-as-datetime,
.display-as-image {
width: 1%;
white-space: nowrap;
}
}

View File

@ -1,4 +1,4 @@
<td>
<td ng-class="'display-as-' + column.displayAs">
<div ng-if="!isValid" class="json-cell-invalid">{{ value }}</div>
<div ng-show="isValid" class="json-cell-valid"></div>
</td>