如何解决动态行详细信息取决于内容高度,ngx-datatable 是否可能?
我想根据 rowDetails
中的内容动态设置 rowDetails 的高度。我试过“自动”或“100%”,但没有按预期工作。
我的 ngx-datatable
启用了虚拟滚动。
<ngx-datatable-row-detail (toggle)="onDetailToggle($event)" [rowHeight]="(getHeight() | async)">
<ng-template let-row="row" let-col="col" ngx-datatable-row-detail-template>
<perfect-scrollbar [scrollIndicators]="true" [autoPropagation]="false" [config]="scrollBarConfig ">
<div class="row-details-container" [ngStyle]="{ 'width': '' + setWidthDynamically() + 'px' }">
<div class="details-container">
<h6>{{ translateHeader('DATAGRID_COL6_TITLE') }}</h6>
<p>{{ row.description }}</p>
</div>
<div class="details-container" *ngIf="row.oldValue?.length > 0 && checkWhatViewHeight().showInfo">
<h6>{{ translateHeader('DATAGRID_COL8_TITLE') }}</h6>
<p class="faded-out">{{ row.oldValue }}</p>
</div>
<div class="details-container" *ngIf="row.newValue?.length > 0 && checkWhatViewHeight().showInfo">
<h6>{{ translateHeader('DATAGRID_COL9_TITLE') }}</h6>
<p class="faded-out">{{ row.newValue }}</p>
</div>
</div>
</perfect-scrollbar>
</ng-template>
</ngx-datatable-row-detail>
getHeight(): Observable<number> {
// how should I write this function??
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。