diff --git a/src/sql/parts/dashboard/widgets/insights/views/tableInsight.component.ts b/src/sql/parts/dashboard/widgets/insights/views/tableInsight.component.ts index 3981405f24..568a11f28d 100644 --- a/src/sql/parts/dashboard/widgets/insights/views/tableInsight.component.ts +++ b/src/sql/parts/dashboard/widgets/insights/views/tableInsight.component.ts @@ -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: '' }) -export default class TableInsight implements IInsightsView, OnInit { +export default class TableInsight extends Disposable implements IInsightsView, OnInit { private table: Table; private dataView: TableDataView; private columns: Slick.Column[]; 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)); } } }