1.0.3 • Published 6 years ago

pt.ang-datatable v1.0.3

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

PT.AngDatatable

This is an Angular Datatable Module. For the moment, this only includes a PaginationComponent, to automatically make your pagination in your table.

Installation

  1. Run this command at the root of your project : npm install pt.ang-datatable

  2. Import it in your AppModule :

import { PaginationModule } from 'pt.ang-datatable';

@NgModule({
    ...
    imports: [
        ...
        PaginationModule
    ],
    ...
})

Usage

  1. Create your HTML and your table, as normally. Example :
<table class="table card-table table-vcenter text-nowrap">
    <thead>
        <tr>
            <th>Acronyme</th>
        </tr>
    </thead>
    <tbody>
        <tr *ngFor="let user of showedList">
            <td><span class="text-muted">{{user.Acronym}}</span></td>
        </tr>

    </tbody>
</table>
  1. After your table closing tag, add the pagination selector :
<pagination
    (outputArray)="showedList = $event"
    [pagesToShow]="3"
    [page]="1"
    [perPage]="25"
    [ListArray]="usersList">
</pagination>
  • outputArray: this is your list the PaginationComponent have pagined
  • pagesToShow: number of buttons that will be displayed
  • page: this is the current page(by default)
  • perPage: number of element per page
  • ListArray: send your array you want to paginate