fix theming issue in table widget (#1391)

This commit is contained in:
Abbie Petchtes
2018-05-11 09:52:58 -07:00
committed by GitHub
parent eae8de0373
commit c0a6f3e012

View File

@@ -6,24 +6,31 @@ import { Component, Input, Inject, ChangeDetectorRef, forwardRef, ElementRef, On
import { getContentHeight, getContentWidth } from 'vs/base/browser/dom';
import { Dimension } from 'vs/base/browser/builder';
import { Disposable } from 'vs/base/common/lifecycle';
import { IInsightsView, IInsightData } from 'sql/parts/dashboard/widgets/insights/interfaces';
import { Table } from 'sql/base/browser/ui/table/table';
import { TableDataView } from 'sql/base/browser/ui/table/tableDataView';
import { DragCellSelectionModel } from 'sql/base/browser/ui/table/plugins/dragCellSelectionModel.plugin';
import { attachTableStyler} from 'sql/common/theme/styler';
import { CommonServiceInterface } from 'sql/services/common/commonServiceInterface.service';
@Component({
template: '<span></span>'
})
export default class TableInsight implements IInsightsView, OnInit {
export default class TableInsight extends Disposable implements IInsightsView, OnInit {
private table: Table<any>;
private dataView: TableDataView<any>;
private columns: Slick.Column<any>[];
constructor(
@Inject(forwardRef(() => ChangeDetectorRef)) private _changeRef: ChangeDetectorRef,
@Inject(forwardRef(() => ElementRef)) private _elementRef: ElementRef
) { }
@Inject(forwardRef(() => ElementRef)) private _elementRef: ElementRef,
@Inject(forwardRef(() => CommonServiceInterface)) private _bootstrap: CommonServiceInterface,
) {
super();
this._elementRef.nativeElement.className = 'slickgridContainer';
}
ngOnInit() {
this.createTable();
@@ -58,6 +65,7 @@ export default class TableInsight implements IInsightsView, OnInit {
if (!this.table) {
this.table = new Table(this._elementRef.nativeElement, this.dataView, this.columns, { showRowNumber: true });
this.table.setSelectionModel(new DragCellSelectionModel());
this._register(attachTableStyler(this.table, this._bootstrap.themeService));
}
}
}