| .. | .. |
|---|
| 42 | 42 | export class PackListComponent implements AfterViewInit { |
|---|
| 43 | 43 | data: any[] = []; |
|---|
| 44 | 44 | columns: ITdDataTableColumn[] = [ |
|---|
| 45 | + { name: 'lics', label: '' }, |
|---|
| 45 | 46 | { name: 'code', label: 'Code', tooltip: 'License pack code' }, |
|---|
| 46 | 47 | { name: 'application_name', label: 'App name' }, |
|---|
| 47 | 48 | { name: 'licensetype_code', label: 'License type' }, |
|---|
| 48 | 49 | { name: 'organization_name', label: 'Organization' }, |
|---|
| 49 | | - { name: 'num_licenses', label: 'Lic', numeric: true, tooltip: 'Initial pack licenses' }, |
|---|
| 50 | | - { name: 'num_available', label: 'Ava', numeric: true, tooltip: 'Available licenses' }, |
|---|
| 50 | + { name: 'used_licenses', label: 'Lics', tooltip: 'Initial/Available pack licenses' }, |
|---|
| 51 | + { name: 'menu', label: '' } |
|---|
| 51 | 52 | ]; |
|---|
| 52 | 53 | |
|---|
| 53 | 54 | filteredData: any[] = this.data; |
|---|
| .. | .. |
|---|
| 80 | 81 | } |
|---|
| 81 | 82 | |
|---|
| 82 | 83 | createPack() : void { |
|---|
| 83 | | - this.dialog.open(PackFormComponent, { |
|---|
| 84 | + var ref = this.dialog.open(PackFormComponent, { |
|---|
| 84 | 85 | height: '50%', // can be px or % |
|---|
| 85 | 86 | width: '40%', // can be px or % |
|---|
| 86 | 87 | }); |
|---|
| 88 | + ref.componentInstance.isNew = true; |
|---|
| 89 | + ref.afterClosed().subscribe(result => { |
|---|
| 90 | + console.log(result); |
|---|
| 91 | + this.filter(); |
|---|
| 92 | + }); |
|---|
| 87 | 93 | } |
|---|
| 88 | 94 | |
|---|
| 95 | + editPack(pack: any) : void { |
|---|
| 96 | + var ref = this.dialog.open(PackFormComponent, { |
|---|
| 97 | + height: '50%', // can be px or % |
|---|
| 98 | + width: '40%', // can be px or % |
|---|
| 99 | + }); |
|---|
| 100 | + ref.componentInstance.isNew = false; |
|---|
| 101 | + ref.componentInstance.data = pack; |
|---|
| 102 | + ref.afterClosed().subscribe(result => { |
|---|
| 103 | + console.log(result); |
|---|
| 104 | + this.filter(); |
|---|
| 105 | + }); |
|---|
| 106 | + } |
|---|
| 107 | + |
|---|
| 108 | + |
|---|
| 89 | 109 | sort(sortEvent: ITdDataTableSortChangeEvent): void { |
|---|
| 90 | 110 | this.sortBy = sortEvent.name; |
|---|
| 91 | 111 | this.sortOrder = sortEvent.order; |
|---|