Files
redash/client/app/components/dynamic-table/dynamic-table.html
2018-02-23 11:19:07 +02:00

47 lines
1.9 KiB
HTML

<div class="dynamic-table-container">
<table class="table table-condensed table-hover">
<thead>
<tr>
<th ng-repeat="column in $ctrl.columns" ng-click="$ctrl.onColumnHeaderClick($event, column)"
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>
<i ng-if="$ctrl.orderByColumnsIndex[column.name] > 0"
ng-class="{
'fa': true,
'fa-caret-down': $ctrl.orderByColumnsDirection[column.name] > 0,
'fa-caret-up': $ctrl.orderByColumnsDirection[column.name] < 0
}"></i>
</th>
<th class="dynamic-table-spacer"></th>
</tr>
</thead>
<thead ng-if="$ctrl.searchColumns.length > 0">
<th class="p-t-10 p-b-10 p-l-15 p-r-15" colspan="{{ $ctrl.columns.length + 1 }}">
<input type="text" class="form-control" placeholder="Search..."
ng-model="$ctrl.searchTerm" ng-model-options="{ allowInvalid: true, debounce: 200 }"
ng-change="$ctrl.onSearchTermChanged()">
</th>
</thead>
<tbody>
<tr ng-repeat="row in $ctrl.rowsToDisplay"
dynamic-table-row columns="$ctrl.columns" row="row"
render="$ctrl.renderSingleRow"
></tr>
</tbody>
</table>
</div>
<div class="paginator-container" ng-if="$ctrl.preparedRows.length > $ctrl.itemsPerPage">
<ul uib-pagination total-items="$ctrl.preparedRows.length"
items-per-page="$ctrl.itemsPerPage"
ng-model="$ctrl.currentPage"
max-size="6"
class="pagination"
boundary-link-numbers="true"
rotate="false"
next-text='&#8594;'
previous-text='&#8592;'
ng-change="$ctrl.onPageChanged()"></ul>
</div>