具有Angular 2的Ngx-datatable禁用分页

时间:2017-09-05 09:15:56

标签: angular pagination ngx-datatable

我有一个表格,其中包含使用ngx-datatable的结果列表。 目前,该表以分页方式显示结果。

我想添加一个按钮来显示所有"没有分页的结果,您认为我应该怎么做?

// Create a place picker. Attempt to display it as a popover if we are on a device which
    // supports popovers.
    let config = GMSPlacePickerConfig(viewport: nil)
    let placePicker = GMSPlacePickerViewController(config: config)
    placePicker.delegate = self
    placePicker.modalPresentationStyle = .popover
    placePicker.popoverPresentationController?.sourceView = pickAPlaceButton
    placePicker.popoverPresentationController?.sourceRect = pickAPlaceButton.bounds

    // Display the place picker. This will call the delegate methods defined below when the user
    // has made a selection.
    self.present(placePicker, animated: true, completion: nil)

3 个答案:

答案 0 :(得分:1)

Ngx-Datatable页脚将隐藏,或者如果您想显示更多按钮,也可以通过编写代码块并使用isVisible变量来显示/隐藏更多按钮来做到这一点

<ngx-datatable-footer>
      <ng-template ngx-datatable-footer-template let-rowCount="rowCount" let-pageSize="pageSize" let-selectedCount="selectedCount"
        let-curPage="curPage" let-offset="offset" let-isVisible="isVisible">
        <div class="container" >

        </div>
      </ng-template>
    </ngx-datatable-footer>

答案 1 :(得分:0)

您可以覆盖页脚模板,以便使用datatable-pager won't appear,因此分页将被禁用。

<ngx-datatable-footer *ngIf="isChild">
  <ng-template ngx-datatable-footer-template>
  this text will appear instead of datatable-pager
  </ng-template>
</ngx-datatable-footer>

答案 2 :(得分:0)

应用[footerHeight]="0",它将删除页脚。