mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Minimum grid height set when grid returns 0 rows (#4716)
This commit is contained in:
@@ -85,4 +85,8 @@
|
|||||||
|
|
||||||
.notebookEditor .notebook-cellTable .ui-widget-content.slick-row {
|
.notebookEditor .notebook-cellTable .ui-widget-content.slick-row {
|
||||||
border-left: 1px silver dotted;
|
border-left: 1px silver dotted;
|
||||||
|
}
|
||||||
|
|
||||||
|
.notebookEditor .notebook-cellTable .slick-viewport {
|
||||||
|
min-height: 39px;
|
||||||
}
|
}
|
||||||
@@ -60,11 +60,16 @@ export function renderDataResource(
|
|||||||
});
|
});
|
||||||
detailTable.registerPlugin(rowNumberColumn);
|
detailTable.registerPlugin(rowNumberColumn);
|
||||||
|
|
||||||
|
let numRows = detailTable.grid.getDataLength();
|
||||||
// Need to include column headers and scrollbar, so that's why 1 needs to be added
|
// Need to include column headers and scrollbar, so that's why 1 needs to be added
|
||||||
let rowsHeight = (detailTable.grid.getDataLength() + 1) * ROW_HEIGHT + BOTTOM_PADDING_AND_SCROLLBAR;
|
let rowsHeight = (numRows + 1) * ROW_HEIGHT + BOTTOM_PADDING_AND_SCROLLBAR;
|
||||||
|
// if no rows are in the grid, set height to 100% of the container's height
|
||||||
// Set the height dynamically if the grid's height is < 500px high; otherwise, set height to 500px
|
if (numRows === 0) {
|
||||||
tableContainer.style.height = rowsHeight >= 500 ? '500px' : rowsHeight.toString() + 'px';
|
tableContainer.style.height = '100%';
|
||||||
|
} else {
|
||||||
|
// Set the height dynamically if the grid's height is < 500px high; otherwise, set height to 500px
|
||||||
|
tableContainer.style.height = rowsHeight >= 500 ? '500px' : rowsHeight.toString() + 'px';
|
||||||
|
}
|
||||||
|
|
||||||
attachTableStyler(detailTable, options.themeService);
|
attachTableStyler(detailTable, options.themeService);
|
||||||
host.appendChild(tableContainer);
|
host.appendChild(tableContainer);
|
||||||
|
|||||||
Reference in New Issue
Block a user