expose the resizable option for table column (#14757)

This commit is contained in:
Alan Ren
2021-03-16 15:45:25 -07:00
committed by GitHub
parent 89e5ee3c80
commit 150dec7211
3 changed files with 15 additions and 5 deletions

View File

@@ -68,6 +68,7 @@ export class AssessmentResultGrid implements vscode.Disposable {
width: 10,
headerCssClass: headerCssClass,
toolTip: localize('asmt.column.targetType', "Target Type"),
resizable: false,
},
{ value: LocalizedStrings.TARGET_COLUMN_NAME, headerCssClass: headerCssClass, width: 125 },
{ value: LocalizedStrings.SEVERITY_COLUMN_NAME, headerCssClass: headerCssClass, width: 100 },

View File

@@ -1021,6 +1021,11 @@ declare module 'azdata' {
* The text to display on the column heading. 'value' property will be used, if not specified
*/
name?: string;
/**
* whether the column is resizable. Default value is true.
*/
resizable?: boolean;
}
export interface IconColumnOptions {

View File

@@ -135,7 +135,8 @@ export default class TableComponent extends ComponentBase<azdata.TableComponentP
headerCssClass: col.headerCssClass,
toolTip: col.toolTip,
formatter: iconCssFormatter,
filterable: false
filterable: false,
resizable: col.resizable
};
}
@@ -148,7 +149,8 @@ export default class TableComponent extends ComponentBase<azdata.TableComponentP
cssClass: col.cssClass,
headerCssClass: col.headerCssClass,
toolTip: col.toolTip,
formatter: textFormatter
formatter: textFormatter,
resizable: col.resizable
};
}
@@ -410,7 +412,7 @@ export default class TableComponent extends ComponentBase<azdata.TableComponentP
width: col.width,
cssClass: col.cssClass,
headerCssClass: col.headerCssClass,
actionOnCheck: checkboxAction,
actionOnCheck: checkboxAction
}, index);
this._register(this._checkboxColumns[col.value].onChange((state) => {
@@ -436,7 +438,8 @@ export default class TableComponent extends ComponentBase<azdata.TableComponentP
iconCssClass: icon ? this.createIconCssClassInternal(icon) : undefined,
field: col.value,
showText: col.showText,
name: col.name
name: col.name,
resizable: col.resizable
});
this._register(this._buttonColumns[col.value].onClick((state) => {
@@ -460,7 +463,8 @@ export default class TableComponent extends ComponentBase<azdata.TableComponentP
width: col.width,
iconCssClass: col.icon ? this.createIconCssClassInternal(col.icon) : undefined,
field: col.value,
name: col.name
name: col.name,
resizable: col.resizable
});
this._hyperlinkColumns[col.value] = hyperlinkColumn;