mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-21 09:35:38 -05:00
Add optional title to tables (#6740)
* Add optional title to tables * addressing comments
This commit is contained in:
@@ -1133,6 +1133,13 @@ class TableComponentWrapper extends ComponentWrapper implements azdata.TableComp
|
||||
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> {
|
||||
let emitter = this._emitterMap.get(ComponentEventType.onSelectedRowChanged);
|
||||
return emitter && emitter.event;
|
||||
|
||||
@@ -208,6 +208,7 @@ export default class TableComponent extends ComponentBase implements IComponent,
|
||||
this._tableColumns = this.transformColumns(this.columns);
|
||||
this._table.columns = this._tableColumns;
|
||||
this._table.setData(this._tableData);
|
||||
this._table.setTableTitle(this.title);
|
||||
if (this.selectedRows) {
|
||||
this._table.setSelectedRows(this.selectedRows);
|
||||
}
|
||||
@@ -286,4 +287,8 @@ export default class TableComponent extends ComponentBase implements IComponent,
|
||||
public get forceFitColumns() {
|
||||
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