Исправить заголовок в ngx-datatable - PullRequest
1 голос
/ 30 октября 2019

Я пытаюсь исправить заголовок ngx-datatable, представленный так: https://swimlane.github.io/ngx-datatable/#virtual-scroll

Мне нужна таблица с фиксированным заголовком и содержимым с возможностью прокрутки.

Ниже приведенокод:

  <ngx-datatable
[rows]="qrCodes"
class="material qr-list-table"
[columnMode]="'force'"

[rowHeight]="'auto'"
[limit]="10"
[count]="10"
[selected]="selected"
[selectAllRowsOnPage]="false"
[displayCheck]="displayCheck"
(activate)="onActivate($event)"
(select)="onSelect($event)"
[scrollbarV]="true"
[scrollbarH]="false"
[selectionType]="SelectionType.checkbox"
(mouseover)="getMouseOver()" (mouseleave)="getMouseLeave()">


<ngx-datatable-column
  [headerCheckboxable]="true"
  [checkboxable]="true">
</ngx-datatable-column>


<ngx-datatable-column prop="name">
  <ng-template ngx-datatable-header-template>
    Name of QR Code
  </ng-template>

  <ng-template ngx-datatable-cell-template let-row="row" let-value="value">
    <div class="row qr-info">
            {{row.name}}
    </div>
  </ng-template>
</ngx-datatable-column>

<ngx-datatable-column prop="created">
  <ng-template ngx-datatable-header-template>
    QR Type
  </ng-template>
    <ng-template ngx-datatable-cell-template let-row="row" let-column="column" let-value="value" ngIf="isHoverButtonVisible">
        {row?.qr_type_display}}
    </ng-template>
</ngx-datatable-column>

и файл ts, откуда я получаю данные, как показано ниже:

ngOnInit() {

this.qrCodes = this.qrCodeService.qrCodes;}

1 Ответ

0 голосов
/ 30 октября 2019

В директиве ngx-datatable передайте другое свойство [scrollbarV]="true"

Например:

<ngx-datatable [scrollbarV]="true"> </ngx-datatable>
...