use ma0646 tabulator scroll fix on students/prestudents list

This commit is contained in:
Harald Bamberger
2026-03-10 11:11:40 +01:00
parent fb388346bf
commit 33252de895
@@ -178,6 +178,14 @@ export default {
event: 'rowSelectionChanged',
handler: this.rowSelectionChanged
},
{
event: 'dataLoading',
handler: this.handleDataLoading
},
{
event: 'renderComplete',
handler: this.handleRenderComplete
},
{
event: 'dataProcessed',
handler: (data) => {
@@ -226,7 +234,10 @@ export default {
tagEndpoint: ApiTag,
currentEndpoint: null,
headerFilterActive: false,
dragSource: []
dragSource: [],
oldScrollUrl: '',
oldScrollLeft: 0,
oldScrollTop: 0
}
},
computed: {
@@ -567,6 +578,24 @@ export default {
this.dragSource = (isAlreadySelected && this.selected?.length) ? this.selected : [data];
},
handleDataLoading() {
this.oldScrollLeft = this.$refs.table.tabulator.rowManager.scrollLeft;
this.oldScrollTop = this.$refs.table.tabulator.rowManager.scrollTop;
},
handleRenderComplete() {
const table = this.$refs.table.tabulator.element.querySelector('.tabulator-tableholder');
if(table) {
const curAjaxUrl = this.$refs.table.tabulator.getAjaxUrl();
if(this.oldScrollUrl === curAjaxUrl) {
table.scrollLeft = this.oldScrollLeft;
table.scrollTop = this.oldScrollTop;
} else {
this.oldScrollLeft = table.scrollLeft;
this.oldScrollTop = table.scrollTop;
}
this.oldScrollUrl = this.$refs.table.tabulator.getAjaxUrl();
}
},
},
// TODO(chris): focusin, focusout, keydown and tabindex should be in the filter component
// TODO(chris): filter component column chooser has no accessibilty features