Open Anton-Plagemann opened 5 months ago
I noticed, that this behaviour (horizontal scroll bar reset) seems to be fixed with the following four small modifications:
Changed:
// Added replace argument
reloadData(data, silent, columnsChanged, replace = false) {
return this.table.dataLoader.load(data, undefined, undefined, replace, silent, columnsChanged);
}
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);
}
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);
}
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. @olifolkerd: If you think those changes would be ok, I would be happy to submit a PR π
I noticed, that this behaviour (horizontal scroll bar reset) seems to be fixed with the following four small modifications:
Original:
Changed:
// Added replace argument reloadData(data, silent, columnsChanged, replace = false) { return this.table.dataLoader.load(data, undefined, undefined, replace, silent, columnsChanged); }
Original:
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:
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:
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. @olifolkerd: If you think those changes would be ok, I would be happy to submit a PR π
Hi, this issue still in 6.2.1 (hope not fixed) i have done what you've exactly done, but instead of remote pagination i'm using progressive_load: scroll, for that what are values are need to be defined in reloadData()
Hi @Ariharan2002,
unfortunately I do not know what needs to be changed for it to work with progressive loading :/ I suggest you take a look by yourself or switch to pagination for now.
Hi @Anton-Plagemann , BTW Thank you for your response :) , will take care of it
I'm using v6.2.1 and the problem persists. anyone have any solution?
Hi @pollux2021 , i have done like take the position of column which you are sorting and then after data sorted (use dataSorted event) use some amount of time in setTimeout block and then scroll to the clicked column, thats how i have worked and its working fine
Hi, just stumbled upon this same bug. This works well on 4.2.7, but not on 6.2.1.
Can confirm that 6.2.5 still has this issue.
Thanks @Anton-Plagemann for the fix, cloned Tabulator, configured build steps (https://tabulator.info/docs/6.2/build#setup), buit and replaced. Everything works as it should!.
@olifolkerd Any chance to add this fix? I would be happy to submit a pr π I'm currently applying the fix to each version manually π
@Anton-Plagemann a pr would be much appreciated, cheers
Oli
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
Create a table with remote pagination, filtering & sorting, e.g.
Scroll to the right of the table.
Click on a column header (sorting), enter a value into the header filter input, or switch to page 2.
See the horizontal scrolling position reset to the most left position.
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 β€οΈ