Skip to content
Snippets Groups Projects
Commit d63fb77e authored by ywb16155's avatar ywb16155
Browse files

commit #27 - adding AgGrid config

parent e76d645b
No related branches found
No related tags found
No related merge requests found
......@@ -17,10 +17,11 @@
<h4 *ngIf="classList.length <= 0">It appears you aren't enrolled anywhere!</h4>
</div>
<ag-grid-angular
style="width: 500px; height: 500px;"
class="ag-theme-balham"
[rowData]="rowData | async"
[columnDefs]="columnDefs"
style="width: 1000px; height: 500px;"
class="ag-theme-balham"
[rowData]="rowData | async"
[columnDefs]="columnDefs"
[gridOptions]="gridOptions"
>
</ag-grid-angular>
</div>
......@@ -6,6 +6,7 @@ import {ActivatedRoute, Router} from '@angular/router';
import {LecturerDataService} from 'src/app/services/lecturer-data.service';
import {LecturerViewService} from 'src/app/services/lecturer-view.service';
import {AgGridNg2} from 'ag-grid-angular/main';
import {GridOptions} from 'ag-grid-community';
@Component({
selector: 'app-lecturer-dashboard',
......@@ -16,10 +17,11 @@ export class LecturerDashboardComponent implements OnInit, OnDestroy {
@ViewChild('agGrid') agGrid: AgGridNg2;
public gridOptions: GridOptions;
public columnDefs = [
{headerName: 'Class Code', field: 'classCode', sortable: true},
{headerName: 'Class Name', field: 'classname', sortable: true},
{headerName: 'Year', field: 'year', sortable: true},
{headerName: 'Class Code', field: 'classCode', sortable: true, lockPosition: true},
{headerName: 'Class Name', field: 'classname', sortable: true, lockPosition: true},
{headerName: 'Year', field: 'year', sortable: true, lockPosition: true},
];
private isAlive = true;
......@@ -38,6 +40,7 @@ export class LecturerDashboardComponent implements OnInit, OnDestroy {
this.route.params.subscribe(params => { this.lecturerId = params.id; }).add(takeWhile(() => this.isAlive));
this.lecturerDataService.lecturerId = this.lecturerId;
this.classList = [];
this.gridOptions = {};
this.rowData = this.lecturerInfoService.getLecturerClasses(this.lecturerId);
this.getClasses();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment