1.1.0 • Published 3 months ago

@laijuthomas/angular-table v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

AngularTable

A bootstrap based table component for Angular 2+

Getting Started

Installation

Install via npm package manager

npm install @laijuthomas/angular-table --save

Usage

Import angular-table module

import { HttpClientModule} from '@angular/common/http';
import { AngularTableModule } from '@laijuthomas/angular-table';

@NgModule({
  imports: [ HttpClientModule, AngularTableModule ]
})

Then in HTML

  <angular-table [totalResults]="listData.count" [loading]="loading" [params]="params" [columns]="columns"
    [page]="page" [config]="config" [data]="listData['results']" (paramsChanged)="onParamsChange($event)">

    <tbody table body>
      <tr *ngFor="let request of listData['results']; let i=index">

      </tr>
      <tr *ngIf="listData.count === 0">
        <td [attr.colspan]="columns.length">No data available in table</td>
      </tr>
    </tbody>
  </angular-table>

Inputs

InputTypeDefaultRequiredDescription
totalResultsnumber | yes | Set the total count of the data array
loadingbooleanfalsenoSet to show loader in the table
paramsHttpParams-noSet existing data params
columnsarray-yesSet table header column data
pagenumber-noSet current page number
dataarray-noSet data to show in the table
configAngularTableConfigdefault confignoconfig for the table

Outputs

OutputDescription
(paramsChanged)Fired when pagination, search, sort etc. changes

Other

NameTypeDescription
AngularTableConfigconfigurationConfiguration for the AngularTable component.

Configuration

InputTypeDefaultRequiredDescription
pagingbooleantruenoSet pagination enabled or not
searchbooleantruenoSet search enabled or not
sortingbooleanyesnoSet table sort enabled or not
responsivebooleanfalsenoSet bootstrap table responsive class
limitbooleanfalsenoSet whether to show the option to change the row count
additionalFiltersbooleanfalsenoSet additional filter block enabled or not
defaultRowCountnumber25noSet number of rows to show in the table
classNamestring | no | Set additional css class to the table component
theadClassNamestring | no | Set css class to the table head
searchClassNamestring | no | Set css class to the table search block

What's included

Within the download you'll find the following directories and files. You'll see something like this:

angular-table/
└── projects/
    ├── angular-table/
    └── angular-table-app/

angular-table/ - library

angular-table-app/ - demo application

Creators

Laiju Thomas

1.1.0

3 months ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.0

3 years ago