# All files / src/app/shared/datatable/table table.component.html

100% Statements 1/1
100% Branches 0/0
100% Functions 0/0
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    18590x

     <cd-error-panel *ngIf="loadingError"
                    i18n>Failed to load data.</cd-error-panel>

    <div class="dataTables_wrapper">
      <div class="dataTables_header clearfix form-inline"
           *ngIf="toolHeader">
        <!-- actions -->
        <div class="oadatatableactions">
          <ng-content select=".table-actions"></ng-content>
        </div>
        <!-- end actions -->

        <!-- filters -->
        <ng-content select=".table-filters"></ng-content>
        <!-- end filters -->

        <!-- search -->
        <div class="input-group">
          <span class="input-group-addon">
            <i class="glyphicon glyphicon-search"></i>
          </span>
          <input class="form-control"
                 type="text"
                 [(ngModel)]="search"
                 (keyup)="updateFilter()">
          <span class="input-group-btn">
            <button type="button"
                    class="btn btn-default clear-input tc_clearInputBtn"
                    (click)="updateFilter(true)">
              <i class="icon-prepend fa fa-remove"></i>
            </button>
          </span>
        </div>
        <!-- end search -->

        <!-- pagination limit -->
        <div class="input-group dataTables_paginate">
          <input class="form-control"
                 type="number"
                 min="1"
                 max="9999"
                 [value]="userConfig.limit"
                 (click)="setLimit($event)"
                 (keyup)="setLimit($event)"
                 (blur)="setLimit($event)">
        </div>
        <!-- end pagination limit-->

        <!-- show hide columns -->
        <div class="widget-toolbar">
          <div dropdown
               class="dropdown tc_menuitem tc_menuitem_cluster">
            <a dropdownToggle
               class="btn btn-sm btn-default dropdown-toggle tc_columnBtn"
               data-toggle="dropdown">
              <i class="fa fa-lg fa-table"></i>
            </a>
            <ul *dropdownMenu
                class="dropdown-menu">
              <li *ngFor="let column of columns">
                <label>
                  <input type="checkbox"
                         (change)="toggleColumn($event)"
                         [name]="column.prop"
                         [checked]="!column.isHidden">
                  <span>{{ column.name }}</span>
                </label>
              </li>
            </ul>
          </div>
        </div>
        <!-- end show hide columns -->

        <!-- refresh button -->
        <div class="widget-toolbar tc_refreshBtn"
             *ngIf="fetchData.observers.length > 0">
          <a (click)="refreshBtn()">
            <i class="fa fa-lg fa-refresh"
               [class.fa-spin]="updating || loadingIndicator"></i>
          </a>
        </div>
        <!-- end refresh button -->
      </div>
      <ngx-datatable #table
                     class="bootstrap oadatatable"
                     [cssClasses]="paginationClasses"
                     [selectionType]="selectionType"
                     [selected]="selection.selected"
                     (select)="onSelect()"
                     [sorts]="userConfig.sorts"
                     (sort)="changeSorting($event)"
                     [columns]="tableColumns"
                     [columnMode]="columnMode"
                     [rows]="rows"
                     [rowClass]="getRowClass()"
                     [headerHeight]="header ? 'auto' : 0"
                     [footerHeight]="footer ? 'auto' : 0"
                     [limit]="userConfig.limit > 0 ? userConfig.limit : undefined"
                     [loadingIndicator]="loadingIndicator"
                     [rowIdentity]="rowIdentity()"
                     [rowHeight]="'auto'">
        <ngx-datatable-footer>
          <ng-template ngx-datatable-footer-template
                       let-rowCount="rowCount"
                       let-pageSize="pageSize"
                       let-selectedCount="selectedCount"
                       let-curPage="curPage"
                       let-offset="offset"
                       let-isVisible="isVisible">
            <div class="page-count">
              <span *ngIf="selectionType">
                {{ selectedCount }} <ng-container i18n="X selected">selected</ng-container> /
              </span>
              <span *ngIf="rowCount != data?.length">
                {{ rowCount }} <ng-container i18n="X found">found</ng-container> /
              </span>
              <span>
                {{ data?.length || 0 }} <ng-container i18n="X total">total</ng-container>
              </span>
            </div>
            <datatable-pager [pagerLeftArrowIcon]="paginationClasses.pagerLeftArrow"
                             [pagerRightArrowIcon]="paginationClasses.pagerRightArrow"
                             [pagerPreviousIcon]="paginationClasses.pagerPrevious"
                             [pagerNextIcon]="paginationClasses.pagerNext"
                             [page]="curPage"
                             [size]="pageSize"
                             [count]="rowCount"
                             [hidden]="!((rowCount / pageSize) > 1)"
                             (change)="table.onFooterPage($event)">
            </datatable-pager>
          </ng-template>
        </ngx-datatable-footer>
      </ngx-datatable>
    </div>

    <!-- Table Details -->
    <ng-content select="[cdTableDetail]"></ng-content>

    <!-- cell templates that can be accessed from outside -->
    <ng-template #tableCellBoldTpl
                 let-value="value">
      <strong>{{ value }}</strong>
    </ng-template>

    <ng-template #sparklineTpl
                 let-row="row"
                 let-value="value">
      <cd-sparkline [data]="value"
                    [isBinary]="row.cdIsBinary"></cd-sparkline>
    </ng-template>

    <ng-template #routerLinkTpl
                 let-row="row"
                 let-value="value">
      <a [routerLink]="[row.cdLink]"
         [queryParams]="row.cdParams">{{ value }}</a>
    </ng-template>

    <ng-template #checkIconTpl
                 let-value="value">
      <i class="fa fa-check fa-fw"
         [hidden]="!value"></i>
    </ng-template>

    <ng-template #perSecondTpl
                 let-row="row"
                 let-value="value">
      {{ value }} /s
    </ng-template>

    <ng-template #executingTpl
                 let-row="row"
                 let-value="value">
      <i class="fa fa-spinner fa-spin fa-fw"
         *ngIf="row.cdExecuting"></i>
      {{ value }}
      <span *ngIf="row.cdExecuting"
            class="text-muted italic">({{ row.cdExecuting }}... )</span>
    </ng-template>

    <ng-template #classAddingTpl
                 let-value="value">
      <span class="{{useCustomClass(value)}}">{{ value }}</span>
    </ng-template>