角度 8 ngx-datatable 页脚不显示

Ike*_*for 0 ngx-datatable angular

我在显示数据表页脚时遇到问题,并且无法在线找到有效的解决方案。我尝试了很多解决方案,包括:ngx-datatable-footer does not work in Angular Aplication和 this:ngx-datatable footer custom以及 SO 之外的许多其他解决方案,但没有一个有效。我过去有时在另一个项目中使用与下面的页脚非常相似的页脚成功地实现了这一点,甚至复制了精确的页脚但没有成功。关于如何让它发挥作用有什么想法吗?

<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>&nbsp;&nbsp;<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>
Run Code Online (Sandbox Code Playgroud)

Ike*_*for 5

弄清楚了问题。显然,不给footerHeight数据表设置属性值会导致表页脚被隐藏:

<ngx-datatable [footerHeight]="50">

设置一下就可以解决这个问题了!