mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-14 01:25:37 -05:00
Fix resource viewer grid resizing (#13197)
* Fix resource viewer grid resizing * keep height
This commit is contained in:
@@ -115,6 +115,7 @@ export class ResourceViewerInput extends EditorInput {
|
||||
resizable: col.resizable ?? true,
|
||||
tooltip: col.tooltip,
|
||||
width: col.width,
|
||||
minWidth: col.width,
|
||||
type: col.type
|
||||
};
|
||||
});
|
||||
|
||||
@@ -79,7 +79,6 @@ export class ResourceViewerEditor extends EditorPane {
|
||||
resourceViewerTableContainer.className = 'resource-viewer-table monaco-editor';
|
||||
resourceViewerTableContainer.style.width = '100%';
|
||||
resourceViewerTableContainer.style.height = '100%';
|
||||
resourceViewerTableContainer.style.overflow = 'hidden';
|
||||
resourceViewerTableContainer.style.position = 'relative';
|
||||
this._resourceViewerTable = this._register(this._instantiationService.createInstance(ResourceViewerTable, resourceViewerTableContainer));
|
||||
return resourceViewerTableContainer;
|
||||
@@ -130,8 +129,10 @@ export class ResourceViewerEditor extends EditorPane {
|
||||
}
|
||||
|
||||
public layout(dimension: DOM.Dimension): void {
|
||||
this._resourceViewerTable.layout();
|
||||
this._container.style.width = dimension.width + 'px';
|
||||
this._container.style.height = dimension.height + 'px';
|
||||
const actionbarHeight = DOM.getTotalHeight(this._actionBar.getContainer());
|
||||
this._container.style.height = (dimension.height - actionbarHeight) + 'px';
|
||||
}
|
||||
|
||||
private showContextMenu(anchor: ContextMenuAnchor, context: azdata.DataGridItem): void {
|
||||
|
||||
@@ -49,8 +49,7 @@ export class ResourceViewerTable extends Disposable {
|
||||
this._dataView.sort(args);
|
||||
}
|
||||
}, {
|
||||
dataItemColumnValueExtractor: dataGridColumnValueExtractor,
|
||||
forceFitColumns: true
|
||||
dataItemColumnValueExtractor: dataGridColumnValueExtractor
|
||||
}));
|
||||
|
||||
this._resourceViewerTable.setSelectionModel(new RowSelectionModel());
|
||||
@@ -95,6 +94,7 @@ export class ResourceViewerTable extends Disposable {
|
||||
|
||||
public set columns(columns: Slick.Column<Slick.SlickData>[]) {
|
||||
this._resourceViewerTable.columns = columns;
|
||||
this._resourceViewerTable.autosizeColumns();
|
||||
}
|
||||
|
||||
public set loading(isLoading: boolean) {
|
||||
@@ -113,6 +113,11 @@ export class ResourceViewerTable extends Disposable {
|
||||
this._resourceViewerTable.unregisterPlugin(plugin);
|
||||
}
|
||||
|
||||
public layout(): void {
|
||||
this._resourceViewerTable.resizeCanvas();
|
||||
this._resourceViewerTable.autosizeColumns();
|
||||
}
|
||||
|
||||
public focus(): void {
|
||||
this._resourceViewerTable.focus();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user