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
| import { Component, OnInit, ViewChild } from '@angular/core'; import { BpmTableComponent } from '../../../components/bpm-table/bpm-table.component';
@Component({ selector: 'app-wbs', templateUrl: './wbs.component.html', styleUrls: ['./wbs.component.css'] }) export class WbsComponent implements OnInit {
constructor() { } dataStyle = { tableName: 'WBS Table Info', enableAction: true, enableAdd: true, enableDelete: true, enableEdit: true, tableHeads: [ { ColumnName: 'No', ColumnType: 'number', ColumnSource: 'No', IsReadOnly: true }, { ColumnName: 'WBS Code', ColumnType: 'text', ColumnSource: 'WBSCode', IsReadOnly: false }, { ColumnName: 'WBS Name', ColumnType: 'text', ColumnSource: 'WBSName', IsReadOnly: false }, { ColumnName: 'Create Date', ColumnType: 'datetime', ColumnSource: 'CreateDate', IsReadOnly: true }, ] };
dataSource = { ResultList: [ { No: 1, PONo: 123, WBSCode: '123123', WBSName: 'WBSName123', CreateDate: '2018/1/1 12:22' }, ], ResultListCount: 1 } @ViewChild('comTable') comTable: BpmTableComponent;
ngOnInit() { } delete(Id) { console.log(Id + "-----"); }
edit(editEntity) { console.log(editEntity); } test() { this.dataSource.ResultList.push({ No: 2, PONo: 123, WBSCode: '123123', WBSName: 'WBSName123', CreateDate: '2018/1/1 12:22', }); this.dataSource.ResultListCount++; this.comTable.loadData(this.dataSource) } }
|