Skip to content
This repository has been archived by the owner on Dec 25, 2021. It is now read-only.

Pagination not working #55

Open
ValdenirAlves opened this issue Oct 25, 2018 · 3 comments
Open

Pagination not working #55

ValdenirAlves opened this issue Oct 25, 2018 · 3 comments

Comments

@ValdenirAlves
Copy link

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
Copy link

hb1998 commented Jan 10, 2019

yeah , Please provide a fix

@brunano21
Copy link
Owner

@ValdenirAlves Can you show your code, please?

@joaquinwojcik
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants