【问题标题】:In Angular, Implementing Frozen Columns with Virtual Scroll, i am seeing multiple scroll bars在 Angular 中,使用虚拟滚动实现冻结列,我看到多个滚动条
【发布时间】:2022-11-12 22:08:36
【问题描述】:

当我在 Angular 中使用 Virtual Scroll 实现 Frozen 列时,我得到了多个滚动条。

我期望只有可滚动列上有单个水平滚动条和单个垂直滚动条。

你能帮我解决同样的问题吗?

以下是我的参考代码

 <div  class="card" style="width: 90%; height: 80%; margin-top: 100px; margin-left: 100px;">

<p-table styleClass="p-datatable-gridlines" [columns]="scrollableColsOld" [value]="virtualCars" 
   [resizableColumns]="true"
    [scrollable]="true" [rows]="10" scrollHeight="250px"
    [virtualScroll]="true"
    [virtualRowHeight]="34"
    [lazy]="true" (onLazyLoad)="loadCarsLazy($event)"
    [frozenColumns]="frozenColsOld"
    frozenWidth="200px"
    >
   <ng-template pTemplate="colgroup" let-columns>
    <colgroup >
        <col *ngFor="let col of columns" [ngStyle]="{'width': col.width}">
    </colgroup>
    </ng-template>
    <ng-template pTemplate="header" let-columns class="parent">
        <tr>
            <th *ngFor="let col of columns" pResizableColumn>
                {{col.header}}
            </th>
        </tr>
    </ng-template>

    <!---->

    <ng-template pTemplate="body" let-rowData let-columns="columns">
        <tr style="height:34px">
            <td *ngFor="let col of columns">
                {{rowData[col.field]}}
            </td>
        </tr>
    </ng-template>
    <ng-template pTemplate="loadingbody" let-columns="columns" >
        <tr style="height:34px">
            <td *ngFor="let col of columns">
                <p-skeleton [ngStyle]="{'width': '100%'}"></p-skeleton>
            </td>
        </tr>
    </ng-template>
</p-table>

【问题讨论】:

    标签: angular primeng primeng-table


    【解决方案1】:

    早上好

    你设法解决了这个问题吗?

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-11-12
    • 2022-08-07
    • 2022-07-01
    • 1970-01-01
    • 2013-01-05
    • 2017-10-16
    • 2011-04-04
    • 1970-01-01
    相关资源
    最近更新 更多