-
Notifications
You must be signed in to change notification settings - Fork 783
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
Horizontal Scroll Position Lost on Header Filter, Header Sort or Pagination Changes (only with Remote Pagination, Filter & Sort) #4494
Comments
I noticed, that this behaviour (horizontal scroll bar reset) seems to be fixed with the following four small modifications: Original: tabulator/src/js/core/CoreFeature.js Lines 11 to 13 in 7333c33
Changed: // Added replace argument
reloadData(data, silent, columnsChanged, replace = false) {
return this.table.dataLoader.load(data, undefined, undefined, replace, silent, columnsChanged);
} Original: tabulator/src/js/modules/Sort/Sort.js Lines 234 to 244 in 7333c33
Changed refreshSort(){
if(this.table.options.sortMode === "remote"){
this.reloadData(null, false, false, true); // Added last argument
}else{
this.refreshData(true);
}
//TODO - Persist left position of row manager
// left = this.scrollLeft;
// this.scrollHorizontal(left);
} Original: tabulator/src/js/modules/Filter/Filter.js Lines 571 to 583 in 7333c33
Changed: refreshFilter(){
if(this.tableInitialized){
if(this.table.options.filterMode === "remote"){
this.reloadData(null, false, false, true); // Added last argument
}else{
this.refreshData(true);
}
}
//TODO - Persist left position of row manager
// left = this.scrollLeft;
// this.scrollHorizontal(left);
} Original: tabulator/src/js/modules/Page/Page.js Lines 773 to 802 in 7333c33
Changed: case "remote":
this.dataChanging = true;
return this.reloadData(null, undefined, undefined, true) // Added the last three arguments
.finally(() => {
this.dataChanging = false;
}); I do however not know if these changes would break something else. |
Describe the bug
Reopening #3450 as a new issue because the old one has been closed with a partial fix only.
The issue: The horizontal scrolling position gets lost when using header filters, header sorting, changing page size or changing page AND remote pagination/filtering/sorting is enabled. Additional details can be found in #3450.
Tabulator Info
Working Example
Could not provide a working example with jsfiddle because a server is needed for remote pagination/sorting/filtering.
To Reproduce
Expected behavior
The scroll position should not reset.
Desktop:
Additional Info
I want to express my appreciation for the Tabulator package and the continuous efforts to improve it. The functionality it provides has been instrumental in developing complex but intuitive interfaces. Thank you for your dedication and hard work on maintaining such a valuable tool ❤️
The text was updated successfully, but these errors were encountered: