aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/browseSdc/vid-table/vid-table.component.ts
blob: aa203090850b8176794ec1d45068120cc6fb75e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/**
 * Created by cp2122 on 1/2/2018.
 */
import { Component, Input, EventEmitter, Output } from '@angular/core';
export class CustomTableColumnDefinition {
  public displayName = '';
  public key = '';
  public type? = 'text';
  public text? = ''; // for button
  public action? = ''; // for button - callback
  public showCondition? = ''; // for button
  // public binding = '';
  public filter? = '';
  // public computedClass: any;
  // public isComputed = false;
  // public isAnchor = false;
  // public srefBinding = '';
}

export class CustomTableConfig {
  public sortBy = '';
  public sortOrder = 'desc';
  public pageSize? = 10;
  public pageNumber? = 1;
  public totalCount? = 0;
  public totalPages? = 0;
  public maxSize? = 10;
  public showSelectCheckbox? = false;
  public showSelectAll? = true;
  public showSort? = true;
  public clientSort? = true;
  public clientPaging? = true;
  public stickyHeader? = true;
  public stickyHeaderOffset? = 0;
  public stickyContainer? = '';
}

export class CustomTableOptions {
  public data: any[];
  public columns: Array<CustomTableColumnDefinition>;
  public config: CustomTableConfig;
  // public callbacks: any;
}
@Component({
  selector: 'vid-table',
  styleUrls: ['./vid-table.component.scss'],
  templateUrl: './vid-table.component.html'
})

export class VidTableComponent {
  @Input() options: CustomTableOptions;
  @Input() filterQuery = '';

  @Output() clickEvent = new EventEmitter<any>();
  clickBtn(row, actionName) {
    row.actionName = actionName;
    this.clickEvent.emit(row);
  }
}