RXTable-library
Easy to use Angular 4+ Table component with both server or client side pagination and sorting.
How to Use
Typical use of the rxtable with a observable service with server side pagination
app.component.html
ID Number Start time Actions {{data.id}} {{data.number}} {{data.startDate}} Details
app.component.ts
;;; ;@ implements OnInit testdata: Function; { } { thistestdata = this_servicegetData; }
dataService.ts
;;;;; @ { } : Observable<IRxTableResponse<Array<any>>> return thishttpget<IRxTableResponse<Array<any>>>'/api/endpoint' params: this private : HttpParams if !params return ; return Object ;
Options
Options for rxtable
component
<rx-table cssClass="table" cssPagination="pagination" pagination="true" sorting="true">
Setting | Description | Default Value |
---|---|---|
cssClass | css class applied to the table | table |
cssPaginator | css class applied to the pagination | pagination |
pagination | enable table pagination | true |
sorting | enable table sorting | true |
cssFooter | css class applied to the pagitor footer | |
sorting | enable table sorting | true |
paginationPages | enable pagination limit dropdown | false |
params | extra parameters to pass to the request obj. |
Options for *rxTableFor
directive
*rxTableFor="let data of testdata; client:true; pagination:2">
Setting | Description | Default Value |
---|---|---|
testdata | array or observable function | |
client | client/server pagination | false |
pagination | number of rows in the table per page | 20 |
Installation
$ npm install rxtable-library
Update app.module.ts
;;;; @
Development
Want to contribute? Great!
npm library: rxtable-library
Todos
- Write Tests
License
MIT