mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-29 17:23:25 -05:00
Auto Column Sizing (#2778)
* add auto column sizing * add break for performance * update with new library
This commit is contained in:
@@ -420,12 +420,12 @@ class GridTable<T> extends Disposable implements IView {
|
||||
@IContextMenuService private contextMenuService: IContextMenuService,
|
||||
@IInstantiationService private instantiationService: IInstantiationService,
|
||||
@IEditorService private editorService: IEditorService,
|
||||
@IUntitledEditorService private untitledEditorService: IUntitledEditorService
|
||||
@IUntitledEditorService private untitledEditorService: IUntitledEditorService,
|
||||
@IConfigurationService private configurationService: IConfigurationService
|
||||
) {
|
||||
super();
|
||||
this.container.style.width = '100%';
|
||||
this.container.style.height = '100%';
|
||||
// this.container.style.marginBottom = BOTTOM_PADDING + 'px';
|
||||
this.container.className = 'grid-panel';
|
||||
|
||||
this.columns = this.resultSet.columnInfo.map((c, i) => {
|
||||
@@ -507,7 +507,7 @@ class GridTable<T> extends Disposable implements IView {
|
||||
this.table = this._register(new Table(tableContainer, { dataProvider: this.dataProvider, columns: this.columns }, tableOptions));
|
||||
this.table.setSelectionModel(this.selectionModel);
|
||||
this.table.registerPlugin(new MouseWheelSupport());
|
||||
this.table.registerPlugin(new AutoColumnSize());
|
||||
this.table.registerPlugin(new AutoColumnSize({ autoSizeOnRender: this.configurationService.getValue('resultsGrid.autoSizeColumns') }));
|
||||
this.table.registerPlugin(copyHandler);
|
||||
this.table.registerPlugin(this.rowNumberColumn);
|
||||
this.table.registerPlugin(new AdditionalKeyBindings());
|
||||
|
||||
@@ -21,7 +21,6 @@ const resultsGridConfiguration: IConfigurationNode = {
|
||||
type: 'object',
|
||||
title: nls.localize('resultsGridConfigurationTitle', "Results Grid"),
|
||||
overridable: true,
|
||||
scope: ConfigurationScope.RESOURCE,
|
||||
properties: {
|
||||
'resultsGrid.fontFamily': {
|
||||
type: 'string',
|
||||
@@ -62,6 +61,11 @@ const resultsGridConfiguration: IConfigurationNode = {
|
||||
],
|
||||
default: RESULTS_GRID_DEFAULTS.cellPadding,
|
||||
description: nls.localize('cellPadding', "Controls the cell padding in pixels")
|
||||
},
|
||||
'resultsGrid.autoSizeColumns': {
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
description: nls.localize('autoSizeColumns', "Auto size the columns width on inital results. Could have performance problems with large number of columns or large cells")
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user