我正在尝试修复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条答案
按热度按时间68bkxrlz1#
请尝试以下代码。它将工作
HTML代码
键入脚本代码