brunano21 / angular-4-data-table

An Angular 5 data table, with pagination, sorting, expandable rows, row selection, etc. with basic accessibility support.
MIT License
11 stars 19 forks source link

Pagination not working #55

Open ValdenirAlves opened 5 years ago

ValdenirAlves commented 5 years ago

Even having the pagination set and being show at the bottom of the table, the pages are not being split and is showing only one page. In my case it should have 8 pages with 10 items in each page.

hb1998 commented 5 years ago

yeah , Please provide a fix

brunano21 commented 5 years ago

@ValdenirAlves Can you show your code, please?

joaquinwojcik commented 5 years ago

Im having the same problem. @brunano21 here's my code.

user.template.html

<data-table id="dataTableUsers" [header]="false" [title]="'Usuarios'" [pageLimits]="limits" [limit]="'2'" [pagination]="true" [showTitle]="false" [substituteRows]="false" [items]="listPeople" [itemCount]="itemCount">
  <data-table-column [property]="'surname'" [header]="'Apellido'"></data-table-column>
  <data-table-column [property]="'name'" [header]="'Nombre'"></data-table-column>
  <data-table-column [property]="'dni'" [header]="'DNI'"></data-table-column>
  <data-table-column [header]="'Fecha Nacimiento'">
     <ng-template #dataTableCell let-item="item">
       {{item.birthDay | date: 'dd/MM/yyyy'}}
     </ng-template>
  </data-table-column>
  <data-table-column [property]="'email'" [header]="'E-mail'"></data-table-column>
  <data-table-column [header]="'Acciones'">
    <ng-template #dataTableCell let-item="item">
      <button class="btn btn-primary btn-xs m-b" (click)="edit(item)"><i class="fa fa-pencil"></i> Editar</button>
      <button class="btn btn-danger btn-xs m-b" (click)="delete(item)"><i class="fa fa-trash"></i> Eliminar</button>
     </ng-template>
  </data-table-column>
</data-table>

user.component.ts

limits = [2,10,20,30]
listPeople = [] //i populate this on ngInit

And this isn't working, cause it never "split" the rows.