mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Add optional title to tables (#6740)
* Add optional title to tables * addressing comments
This commit is contained in:
@@ -32,7 +32,9 @@ export class DacFxSummaryPage extends BasePage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async start(): Promise<boolean> {
|
async start(): Promise<boolean> {
|
||||||
this.table = this.view.modelBuilder.table().component();
|
this.table = this.view.modelBuilder.table().withProperties({
|
||||||
|
title: localize('dacfx.summaryTableTitle', 'Summary of settings')
|
||||||
|
}).component();
|
||||||
this.loader = this.view.modelBuilder.loadingComponent().withItem(this.table).component();
|
this.loader = this.view.modelBuilder.loadingComponent().withItem(this.table).component();
|
||||||
this.form = this.view.modelBuilder.formContainer().withFormItems(
|
this.form = this.view.modelBuilder.formContainer().withFormItems(
|
||||||
[
|
[
|
||||||
|
|||||||
1
src/sql/azdata.d.ts
vendored
1
src/sql/azdata.d.ts
vendored
@@ -3239,6 +3239,7 @@ declare module 'azdata' {
|
|||||||
fontSize?: number | string;
|
fontSize?: number | string;
|
||||||
selectedRows?: number[];
|
selectedRows?: number[];
|
||||||
forceFitColumns?: ColumnSizingMode;
|
forceFitColumns?: ColumnSizingMode;
|
||||||
|
title?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface FileBrowserTreeProperties extends ComponentProperties {
|
export interface FileBrowserTreeProperties extends ComponentProperties {
|
||||||
|
|||||||
@@ -339,4 +339,8 @@ export class Table<T extends Slick.SlickData> extends Widget implements IDisposa
|
|||||||
this._grid.setOptions(newOptions);
|
this._grid.setOptions(newOptions);
|
||||||
this._grid.invalidate();
|
this._grid.invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public setTableTitle(title: string): void {
|
||||||
|
this._tableContainer.title = title;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1133,6 +1133,13 @@ class TableComponentWrapper extends ComponentWrapper implements azdata.TableComp
|
|||||||
this.setProperty('forceFitColumns', v);
|
this.setProperty('forceFitColumns', v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get title(): string {
|
||||||
|
return this.properties['title'];
|
||||||
|
}
|
||||||
|
public set title(v: string) {
|
||||||
|
this.setProperty('title', v);
|
||||||
|
}
|
||||||
|
|
||||||
public get onRowSelected(): vscode.Event<any> {
|
public get onRowSelected(): vscode.Event<any> {
|
||||||
let emitter = this._emitterMap.get(ComponentEventType.onSelectedRowChanged);
|
let emitter = this._emitterMap.get(ComponentEventType.onSelectedRowChanged);
|
||||||
return emitter && emitter.event;
|
return emitter && emitter.event;
|
||||||
|
|||||||
@@ -208,6 +208,7 @@ export default class TableComponent extends ComponentBase implements IComponent,
|
|||||||
this._tableColumns = this.transformColumns(this.columns);
|
this._tableColumns = this.transformColumns(this.columns);
|
||||||
this._table.columns = this._tableColumns;
|
this._table.columns = this._tableColumns;
|
||||||
this._table.setData(this._tableData);
|
this._table.setData(this._tableData);
|
||||||
|
this._table.setTableTitle(this.title);
|
||||||
if (this.selectedRows) {
|
if (this.selectedRows) {
|
||||||
this._table.setSelectedRows(this.selectedRows);
|
this._table.setSelectedRows(this.selectedRows);
|
||||||
}
|
}
|
||||||
@@ -286,4 +287,8 @@ export default class TableComponent extends ComponentBase implements IComponent,
|
|||||||
public get forceFitColumns() {
|
public get forceFitColumns() {
|
||||||
return this.getPropertyOrDefault<azdata.TableComponentProperties, ColumnSizingMode>((props) => props.forceFitColumns, ColumnSizingMode.ForceFit);
|
return this.getPropertyOrDefault<azdata.TableComponentProperties, ColumnSizingMode>((props) => props.forceFitColumns, ColumnSizingMode.ForceFit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get title() {
|
||||||
|
return this.getPropertyOrDefault<azdata.TableComponentProperties, string>((props) => props.title, '');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user