2 * Created by cp2122 on 1/2/2018.
4 import { Component, Input, EventEmitter, Output } from '@angular/core';
5 export class CustomTableColumnDefinition {
6 public displayName = '';
9 public text? = ''; // for button
10 public action? = ''; // for button - callback
11 public showCondition? = ''; // for button
12 // public binding = '';
14 // public computedClass: any;
15 // public isComputed = false;
16 // public isAnchor = false;
17 // public srefBinding = '';
20 export class CustomTableConfig {
22 public sortOrder = 'desc';
23 public pageSize? = 10;
24 public pageNumber? = 1;
25 public totalCount? = 0;
26 public totalPages? = 0;
28 public showSelectCheckbox? = false;
29 public showSelectAll? = true;
30 public showSort? = true;
31 public clientSort? = true;
32 public clientPaging? = true;
33 public stickyHeader? = true;
34 public stickyHeaderOffset? = 0;
35 public stickyContainer? = '';
38 export class CustomTableOptions {
40 public columns: Array<CustomTableColumnDefinition>;
41 public config: CustomTableConfig;
42 // public callbacks: any;
45 selector: 'vid-table',
46 styleUrls: ['./vid-table.component.scss'],
47 templateUrl: './vid-table.component.html'
50 export class VidTableComponent {
51 @Input() options: CustomTableOptions;
52 @Input() filterQuery = '';
54 @Output() clickEvent = new EventEmitter<any>();
55 clickBtn(row, actionName) {
56 row.actionName = actionName;
57 this.clickEvent.emit(row);