0.0.9 • Published 2 years ago

my-monty-dynamic-table v0.0.9

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

MyMontyDynamicTable

This library was generated with Angular CLI version 14.1.0.

How to use

app.component.html

<myMonty-Dynamic-Table 
[actions]="actions"
[showError]="isError"
(action)="onTableAction($event)"
[multipleRowActions]="multipleRowActions"
(onDelete)="onDelete($event)"
(onPrint)="onPrint($event)"
(onExportExcel)="onExportExcel($event)"
(onExportPdf)="onExportPdf($event)"
(onAdd)="onAdd($event)"
[showTotalPages]="10"
[pageSize]="5"
[dataset]="data" 
[columns]="columns">
</myMonty-Dynamic-Table>

app.component.ts

isError = false;
constructor(private http: HttpClient) { }
columns = [
    { columnDef: 'description', header: 'Title' },
];
actions = ['view','edit','delete'];
multipleRowActions = ['delete','print','exportExcel','exportPdf','add']
data = new BehaviorSubject([]);

ngOnInit() {
    this.getData()
}

getData():any{
    this.http.get<any[]>("http://localhost:1555/api/v1/categories").subscribe((res:any)=> {
    this.data.next(res);
    });
}

onTableAction(event: any) {
    console.log('event', event)
}

onDelete(event: any){
    console.log('event', event)
}
onPrint(event: any){
    console.log('event', event)
}
onExportExcel(event: any){
    console.log('event', event)
}
onExportPdf(event: any){
    console.log('event', event)
}
onAdd(event: any){
    console.log('event', event);
    //this.getData();
}
ngOnDestroy(): void {
    if(this.data) {
        this.data.unsubscribe();
    }
}
0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.5

3 years ago

0.0.6

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago