0

I have a table with a list of result using ngx-datatable. Currently, the table displays the results with pagination.

I'd like to add a button to "show all" results without pagination, How do you think I should do that?

<ngx-datatable class="material"
[rows]="rows"
[columnMode]="'force'"
[headerHeight]="40"
[footerHeight]="40"
[rowHeight]="30"
[externalPaging]="true"
[limit]="50"
[selectionType]="'checkbox'">
<ngx-datatable-column
        [width]="30"
        [sortable]="false"
        [canAutoResize]="false"
        [draggable]="false"
        [resizeable]="false"
        [headerCheckboxable]="true"
        [checkboxable]="true">
      </ngx-datatable-column>
          <ngx-datatable-column name="Name">
            <ng-template let-value="value" ngx-datatable-cell-template>
                <div class="redNumber">{{value}}</div>
            </ng-template>
      </ngx-datatable-column>
      <ngx-datatable-column name="Title"></ngx-datatable-column>
      <ngx-datatable-column name="company"></ngx-datatable-column>
      <ngx-datatable-column name="Status" [cellClass]="getStatusClass">  
  </ngx-datatable-column>
<ngx-datatable-column name="Last connexion"></ngx-datatable-column>
Rohan Fating
  • 2,135
  • 15
  • 24
Marc El Bichon
  • 397
  • 1
  • 7
  • 24

3 Answers3

2

Ngx-Datatable Footer will hide or if you want show more button you can do that too by writing block and use isVisible variable to show/hide more button

<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>
Arfan Mirza
  • 668
  • 1
  • 14
  • 24
0

You can override the footer-template so the datatable-pager won't appear and therefore the pagination will be disabled.

<ngx-datatable-footer *ngIf="isChild">
  <ng-template ngx-datatable-footer-template>
  this text will appear instead of datatable-pager
  </ng-template>
</ngx-datatable-footer>
Pedro Hidalgo
  • 861
  • 10
  • 15
0

Apply [footerHeight]="0" and it'll remove the footer.

Mario Petrovic
  • 7,500
  • 14
  • 42
  • 62