-
Notifications
You must be signed in to change notification settings - Fork 332
fix(grid): [grid] fix footer bug in visual scroll scene #2839
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1644,8 +1644,10 @@ const Methods = { | |
| // 设置新的渲染列触发Vue渲染 | ||
| this.tableColumn = ret.tableColumn | ||
| this.visibleColumnChanged = ret.visibleColumnChanged | ||
|
|
||
| this.$nextTick(this.updateStyle) | ||
| this.$nextTick(() => { | ||
| this.updateFooter() | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The update to call |
||
| this.updateStyle() | ||
| }) | ||
| }) | ||
| }, | ||
| // 更新横向 X 可视渲染上下剩余空间大小 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,6 +44,7 @@ function getTableWidth({ scrollXLoad, tWidth, tableColumn }) { | |
| } | ||
|
|
||
| function layoutFooter({ | ||
| elemStore, | ||
| customHeight, | ||
| footerHeight, | ||
| headerHeight, | ||
|
|
@@ -61,6 +62,11 @@ function layoutFooter({ | |
| let tWidth = tableWidth | ||
| // 如果是固定列与设置了超出隐藏 | ||
| let ret = getTableWidth({ scrollXLoad, tWidth, tableColumn }) | ||
| // 为表尾设置虚拟滚动占位宽度 | ||
| const spaceElem = elemStore['main-footer-x-space'] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding a virtual scroll placeholder width for the footer helps in maintaining the correct layout when horizontal scrolling is involved. This ensures that the footer aligns properly with the table content. |
||
| if (spaceElem) { | ||
| spaceElem.style.width = `${tableWidth}px` | ||
| } | ||
|
|
||
| tableColumn = ret.tableColumn | ||
| tWidth = ret.tWidth | ||
|
|
@@ -242,6 +248,7 @@ export function handleLayout(params) { | |
| tableColumn = ret.tableColumn | ||
| } else if (layout === 'footer') { | ||
| tableColumn = layoutFooter({ | ||
| elemStore, | ||
| customHeight, | ||
| fixedWrapperElem, | ||
| footerHeight, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable
scrollLeftis introduced to storebodyElem.scrollLeft, which is then used to setheaderElem.scrollLeftandfooterElem.scrollLeft. This change ensures that the scroll position is consistent across header and footer, which is crucial for visual alignment.