start of StatusList component

This commit is contained in:
Jesse Lucas
2020-03-10 22:51:50 -04:00
parent 3eb6045dee
commit 1d249a877e
17 changed files with 302 additions and 537 deletions
@@ -0,0 +1,34 @@
import { AfterViewInit, Component, OnInit, ViewChild } from '@angular/core';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort } from '@angular/material/sort';
import { MatTable } from '@angular/material/table';
import { StatusListFolderDataSource } from './status-list-folder-datasource';
import { Folder } from '../folder';
import { SystemConfigService } from '../system-config.service';
@Component({
selector: 'app-status-list',
templateUrl: './status-list.component.html',
styleUrls: ['./status-list.component.scss']
})
export class StatusListComponent implements AfterViewInit, OnInit {
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
@ViewChild(MatTable) table: MatTable<Folder>;
dataSource: StatusListFolderDataSource;
/** Columns displayed in the table. Columns IDs can be added, removed, or reordered. */
displayedColumns = ['id', 'name'];
constructor(private systemConfigService: SystemConfigService) { };
ngOnInit() {
this.dataSource = new StatusListFolderDataSource(this.systemConfigService);
}
ngAfterViewInit() {
this.dataSource.sort = this.sort;
this.dataSource.paginator = this.paginator;
this.table.dataSource = this.dataSource;
}
}