Skip to content

Commit bb83d55

Browse files
committed
grid.Container: scrolling concept #6180
1 parent 80b7c2c commit bb83d55

5 files changed

Lines changed: 27 additions & 26 deletions

File tree

resources/scss/src/grid/Container.scss

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.neo-grid-wrapper {
2-
position: relative;
2+
overflow-x: auto;
3+
position : relative;
34
}
45

56
.neo-grid-container {
@@ -10,7 +11,6 @@
1011
font-weight : 400;
1112
height : 100%;
1213
line-height : 19px;
13-
overflow : hidden;
1414
position : absolute;
1515
width : 100%;
1616

@@ -69,9 +69,4 @@
6969
padding : 2px 10px 2px;
7070
width : fit-content;
7171
}
72-
73-
.neo-grid-view-wrapper {
74-
overflow: auto;
75-
position: relative;
76-
}
7772
}

resources/scss/src/grid/View.scss

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1+
.neo-grid-view-wrapper {
2+
overflow-x: hidden;
3+
overflow-y: auto;
4+
position : relative;
5+
6+
.neo-grid-scrollbar {
7+
height : 1px;
8+
position : absolute;
9+
top : 0;
10+
visibility : hidden;
11+
width : 1px;
12+
}
13+
}
14+
115
.neo-grid-view {
16+
overflow-x: visible;
17+
218
&.neo-is-scrolling * {
319
pointer-events: none !important;
420
}
@@ -77,13 +93,3 @@
7793
}
7894
}
7995
}
80-
81-
.neo-grid-view-wrapper {
82-
.neo-grid-scrollbar {
83-
height : 1px;
84-
position : absolute;
85-
top : 0;
86-
visibility : hidden;
87-
width : 1px;
88-
}
89-
}

resources/scss/src/grid/header/Button.scss

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@
2020
border-right: 1px solid var(--grid-container-border-color);
2121
}
2222

23-
&.neo-locked { // todo: for testing, will get removed once the header toolbar is outside of the scroll region
24-
position: sticky;
25-
top : 0;
26-
z-index : 5001;
23+
&.neo-locked {
24+
2725
}
2826

2927
&.neo-drag-over {

src/grid/View.mjs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ class GridView extends Component {
187187
*/
188188
afterSetAvailableWidth(value, oldValue) {
189189
if (value > 0) {
190+
this.vdom.width = value + 'px';
190191
this.vdom.cn[1].width = value + 'px';
191192
this.update()
192193
}
@@ -496,10 +497,6 @@ class GridView extends Component {
496497
me.getVdomRoot().cn = rows;
497498

498499
me.promiseUpdate().then(() => {
499-
me.getDomRect(me.id).then(rect => {
500-
me.availableWidth = rect.width
501-
})
502-
503500
if (selectedRows?.length > 0) {
504501
// this logic only works for selection.grid.RowModel
505502
Neo.main.DomAccess.scrollToTableRow({appName: me.appName, id: selectedRows[0]})

src/grid/header/Toolbar.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@ class Toolbar extends BaseToolbar {
6262
let me = this;
6363

6464
value && me.getDomRect(me.items.map(item => item.id)).then(rects => {
65-
me.gridContainer.view.columnPositions = rects.map(item => ({width: item.width, x: item.x}))
65+
let lastItem = rects[rects.length -1];
66+
67+
me.gridContainer.view.set({
68+
availableWidth : lastItem.x + lastItem.width - rects[0].x,
69+
columnPositions: rects.map(item => ({width: item.width, x: item.x}))
70+
})
6671
})
6772
}
6873

0 commit comments

Comments
 (0)