angular 8 ngx-datatable 页脚不显示
angular 8 ngx-datatable footer not displaying
我在显示数据表页脚时遇到问题,无法在线找到有效的解决方案。我已经尝试了许多解决方案,包括:ngx-datatable-footer does not work in Angular Aplication and this: 以及 SO 之外的许多其他解决方案,但 none 已经奏效。我在另一个项目中实现了这一点,过去有时使用与下面的页脚非常相似的页脚成功地实现了这一点,甚至复制了准确的页脚也没有成功。关于如何让它工作的任何想法?
<ngx-datatable-footer #tFooter (onFooterPage)="handleF($event)">
<ng-template ngx-datatable-footer-template let-rowCount="rowCount" let-pageSize="pageSize" let-selectedCount="selectedCount" let-curPage="curPage" let-offset="offset">
<span class="pl-3 text-primary">SHOWING:</span> <span class="text-muted text-sm"> {{curPage > 1 ? (curPage * pageSize) - pageSize : curPage}} - {{(pageSize * curPage) < rowCount ? pageSize * curPage : rowCount}} of {{rowCount}}</span>
<datatable-pager (onFooterPage)="handleF($event)" (change)="table.onFooterPage($event)" [pagerLeftArrowIcon]="'datatable-icon-left'" [pagerRightArrowIcon]="'datatable-icon-right'" [pagerPreviousIcon]="'datatable-icon-prev'" [pagerNextIcon]="'datatable-icon-skip'" [page]="curPage" [size]="pageSize" [count]="rowCount">
</datatable-pager>
</ng-template>
</ngx-datatable-footer>
解决了问题。显然,不在数据 table 上设置 footerHeight
属性值将导致隐藏 table 页脚:
<ngx-datatable [footerHeight]="50">
设置它可以解决问题![=12=]
我在显示数据表页脚时遇到问题,无法在线找到有效的解决方案。我已经尝试了许多解决方案,包括:ngx-datatable-footer does not work in Angular Aplication and this:
<ngx-datatable-footer #tFooter (onFooterPage)="handleF($event)">
<ng-template ngx-datatable-footer-template let-rowCount="rowCount" let-pageSize="pageSize" let-selectedCount="selectedCount" let-curPage="curPage" let-offset="offset">
<span class="pl-3 text-primary">SHOWING:</span> <span class="text-muted text-sm"> {{curPage > 1 ? (curPage * pageSize) - pageSize : curPage}} - {{(pageSize * curPage) < rowCount ? pageSize * curPage : rowCount}} of {{rowCount}}</span>
<datatable-pager (onFooterPage)="handleF($event)" (change)="table.onFooterPage($event)" [pagerLeftArrowIcon]="'datatable-icon-left'" [pagerRightArrowIcon]="'datatable-icon-right'" [pagerPreviousIcon]="'datatable-icon-prev'" [pagerNextIcon]="'datatable-icon-skip'" [page]="curPage" [size]="pageSize" [count]="rowCount">
</datatable-pager>
</ng-template>
</ngx-datatable-footer>
解决了问题。显然,不在数据 table 上设置 footerHeight
属性值将导致隐藏 table 页脚:
<ngx-datatable [footerHeight]="50">
设置它可以解决问题![=12=]