Skip to content

Commit e48801d

Browse files
committed
Show all column headers in full by default (#7168)
* ui: Let the name of the last column to expand to its full width This is meant to improve the UX in two situations: * if the grid is narrower than the screen, then it makes little sense to cut off the last column name because there is free space afterwards, so better let it expand * if the grid is wider than the screen, then it is impossible to drag the edge of the last column to the right, since there is no space on the right. So better have the column expanded to show the full column name too. * ui: Add padding to the grid to make it possible to resize the last column Closes #7167. * Switch to showing full column names by default
1 parent 1a27e73 commit e48801d

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

main/webapp/modules/core/scripts/views/data-table/data-table-view.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ DataTableView.prototype._startResizing = function(columnIndex, clickEvent) {
105105
// for conversion from px to em
106106
state.emFactor = parseFloat(getComputedStyle($(".data-table-container colgroup")[0]).fontSize);
107107

108+
state.col.width(state.originalWidth);
109+
columnHeader._td.classList.add('resized-column');
110+
108111
$('body')
109112
.on('mousemove', DataTableView.mouseMoveListener)
110113
.on('mouseup', DataTableView.mouseReleaseListener);

main/webapp/modules/core/styles/views/data-table-view.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ div.viewpanel-pagesize span:first-of-type {
109109
font-size: 1.05em;
110110
border-collapse: separate;
111111
width: max-content;
112+
padding-right: 3em;
112113
}
113114

114115
.data-table td, .data-table-header td, .data-table-header th {
@@ -203,6 +204,10 @@ table.data-table td.column-header, table.data-table th.column-header {
203204
.column-header-name {
204205
padding: 4px 0 0 0;
205206
display: inline-block;
207+
position: initial;
208+
}
209+
210+
th.resized-column .column-header-name {
206211
position: absolute;
207212
}
208213

@@ -217,6 +222,7 @@ table.data-table td.column-header, table.data-table th.column-header {
217222
border: none;
218223
padding: 0;
219224
background-color: transparent;
225+
vertical-align: top;
220226
}
221227

222228
.column-header-menu-expand {

0 commit comments

Comments
 (0)