JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q53675F
  • License MIT

Angular 2 table based on bootstrap and webservices paginated requests

Package Exports

  • ng2-iq-bootstraptable

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ng2-iq-bootstraptable) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

NG2 IQ-BOOTSTRAP-TABLE (DEPRECTATED => look for NGX-IQ-BOOTSTRAPTABLE

InnQUbe

Dependency Status devDependency Status Code Climate Build Status

This table is an Angular 2 component based on Bootstrap3. Is prepared to handle server side requests for filtering, ordering and pagination of results, without needing to write a lot of boilerplate every time you have to add a new table view to your project.

Included sample screenshot: Screenshot

Usage example:

app.component.html:

<iq-bt-table 
(onLoadData)="loadData($event)" 
        [paginatedResults]="paginatedResults" 
        [columns]="columns" 
        [pageSize]=5
        [footerLegend]="footerLegend">
    <template #rows let-item="$implicit" let-i="index">
        <tr>
            <td>{{item.id}}</td>
            <td>{{item.firstname}}</td>
            <td>{{item.lastname}}</td>
            <td>{{item.email}}</td>
        </tr>
    </template>
</iq-bt-table>

app.component.ts:

    import { TableComponent, PaginatedResults, BootstrapTableColumn, DataRequestConfig } from 'ng2-iq-bootstraptable';
    @Component({
        selector: 'app-customers-list',
        templateUrl: './customers-list.component.html',
        styleUrls: ['./customers-list.component.css']
    })
    export class CustomersListComponent implements OnInit {
        private paginatedResults: PaginatedResults<Customer>;
        private drc: DataRequestConfig;
        private columns: BootstrapTableColumn[] = [
            {
                name: 'Id',
                prop: 'id',
                width: 10,
                widthUnit: '%'
            }, {
                name: 'First name',
                prop: 'firstname',
                width: 30,
                widthUnit: '%'
            }, {
                name: 'Last name',
                prop: 'lastname',
                width: 30,
                widthUnit: '%'
            }, {
                name: 'E-Mail',
                prop: 'email',
                width: 30,
                widthUnit: '%'
            }
        ];
        private footerLegend: FooterLegend = {
            showingResults: 'Mostrando resultados',
            of: 'de',
            to: 'al'
        };
        loadData(drc: DataRequestConfig) {
            this.drc = drc;
            let from = drc.firstResult;
            let sort = drc.orderBy === undefined ? null : drc.orderBy[0].property;
            let sortDir = drc.orderBy === undefined ? null : drc.orderBy[0].direction;
            this.customerService
                .listCustomers(from, drc.count, sort, sortDir)
                .subscribe((paginatedData) => {
                    this.paginatedResults = paginatedData;
                });
        }
    }