6.1.1 • Published 6 days ago

@universis/ngx-tables v6.1.1

Weekly downloads
-
License
-
Repository
-
Last release
6 days ago

@universis/ngx-tables

An implementation of datatables.net for Universis project applications.

Installation

Install @universis/ngx-tables in an angular cli by executing:

npm i @universis/ngx-tables

Important note: Don't forget to install peer dependencies also.

Usage

Import TablesModule:

# app.module.ts
import { TablesModule } from '@universis/ngx-tables';
...
imports: [
  CommonModule,
  BrowserModule,
  HttpClientModule,
  TranslateModule.forRoot(),
  SharedModule.forRoot(),
  RouterModule,
  ...
  ...
  TablesModule
],

Add AdvancedTableComponent:

<app-advanced-table #table [config]="tableConfiguration"></app-advanced-table>

and load a table configuration:

export const TABLE1_COFIGURATION = {
  "title": "Students",
  "model": "Students",
  "searchExpression":"indexof(person/familyName, '${text}') ge 0 or indexof(person/givenName, '${text}') ge 0",
  "selectable": false,
  "multipleSelect": false,
  "columns": [
    {
      "name":"id",
      "property": "id",
      "hidden": true
    },
    {
      "name":"person/familyName",
      "property": "familyName",
      "title":"Family Name"
    },
    {
      "name":"person/givenName",
      "property": "givenName",
      "title":"Given Name"
    },
    ...
  ],
  "criteria": [
    {
      "name": "studentName",
      "filter": "(indexof(person/familyName, '${value}') ge 0 or indexof(person/givenName, '${value}') ge 0)",
      "type": "text"
    },
    {
      "name": "username",
      "filter": "(indexof(user/name, '${value}') ge 0)",
      "type": "text"
    },
    ...
  ],
  "searches": [
  ],
  "defaults":{
    "filter": "studentStatus/alternateName eq eq 'active'"
  },
  "paths" : [
  ]
}

Use this configuration in component:

# table1.component.ts
import {TABLE1_COFIGURATION} from './table1.configuration';
@Component({
  selector: 'app-table1',
  templateUrl: './table1.component.html'
})
export class Table1Component implements OnInit {
  
  public tableConfiguration: any = TABLE1_COFIGURATION;
  public filter: any = {};
  
  constructor() {
  }

  ngOnInit() {
  }

}

AdvancedTableComponent uses table configuration to load data from the given model and draw datatable. Use AdvancedTableComponent.configSrc to load table configuration from a json file.

<app-advanced-table #table [autoLoad]=false [configSrc]="'/assets/tables/table3.config.json'"></app-advanced-table>

AdvancedSearchComponent enables search operation against a loaded datatable.

<app-advanced-table-search #advancedSearch [mergeQueryParams]="true" [(filter)]="filter.value" [collapsed]="false" [showMore]="true" [table]="table">
 <advanced-search>
      <app-advanced-search-form [formSrc]="'/assets/tables/table2.search.json'" #search [(filter)]="filter.value"></app-advanced-search-form>
  </advanced-search>
</app-advanced-table-search>

AdvancedSearchComponent has a simple text box for text search based on AdvancedTableComponent#config.searchExpression expression.

AdvancedSearchComponent may also have an advanced search form for searching by using lookup tables, numbers, booleans etc.

6.1.1

6 days ago

6.1.0

4 months ago

6.0.3

6 months ago

6.0.4

6 months ago

6.0.2

11 months ago

6.0.1

12 months ago

15.0.6

12 months ago

15.0.7

12 months ago

15.0.5

12 months ago

0.8.5

1 year ago

0.8.4

1 year ago

15.0.2

12 months ago

15.0.3

12 months ago

6.0.0

12 months ago

0.8.1

1 year ago

0.8.3

1 year ago

0.8.2

1 year ago

0.7.30

1 year ago

0.7.29

1 year ago

0.8.0

1 year ago

0.7.28

1 year ago

0.7.27

2 years ago

0.7.24

2 years ago

0.7.23

2 years ago

0.7.26

2 years ago

0.7.25

2 years ago

0.7.19

2 years ago

0.7.17

2 years ago

0.7.21

2 years ago

0.7.20

2 years ago

0.7.15

2 years ago

0.7.14

2 years ago

0.7.9

2 years ago

0.7.13

2 years ago

0.7.12

2 years ago

0.7.6

2 years ago

0.7.5

2 years ago

0.7.8

2 years ago

0.7.7

2 years ago

0.7.2

2 years ago

0.7.4

2 years ago

0.7.3

2 years ago

0.7.1

2 years ago

0.6.21

2 years ago

0.6.20

2 years ago

0.6.19

2 years ago

0.6.18

2 years ago

0.6.16

2 years ago

0.6.15

2 years ago

0.6.12

3 years ago

0.6.11

3 years ago

0.6.14

3 years ago

0.6.13

3 years ago

0.6.10

3 years ago

0.6.9

3 years ago

0.6.8

3 years ago

0.6.7

3 years ago

0.6.6

3 years ago

0.6.5

3 years ago

0.6.4

3 years ago

0.6.2

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago