Hello,
When having a vertical scrollbar in the grin and scrolling all the way to the right.
If you then call "updateData" using with "partial: true" this resets the scroll to the left side: https://jsfiddle.net/njkbd5s9/
/Jimmy
Hello, Jimmy,
Thank you for reaching out to us.
We suggest executing the following code snippet before actual data update to restore scroll position:
const scrollPane = document.querySelector(".fm-data-sheet > div");
const initialPosition = {
x: scrollPane.scrollLeft,
y: scrollPane.scrollTop
}
pivot.on("aftergriddraw", () => {
pivot.off("aftergriddraw");
setTimeout(() => {
scrollPane.scrollTo(initialPosition.x, initialPosition.y);
}, 0);
});
It allows saving scroll position before the data was updated and restore it after the render is complete.
Here is JSFiddle demonstrating this approach: https://jsfiddle.net/flexmonster/10jpvfco/.
Please let us know if it helps.
Kind regards,
Illia
Hello Illia,
Thanks this works for the vertical scroll.
But using it with the horizontal scroll it doesn't scroll all the way: horizontal
/Jimmy
Hello,
Thank you for your feedback.
Please note that this is only the workaround that may produce slight differences in a horizontal scroll on the flat form. This is due to possible differences in columns' width after the data update.
Currently, there are no other workarounds for this case.
Please contact us if other questions arise.
Kind regards,
Illia
Hello
I tried the functionality you mentioned above.
It works properly only if the user is in the middle of the report table.
For example if user removes very last column, then the scroller appears a little away than the last column․
But I noticed that this happens if there are more than 38 columns.
Hello, Tigran!
Thank you for contacting us.
We have moved your question to a separate thread and provided an answer there: https://www.flexmonster.com/question/how-to-remain-scroll-at-the-right-end-after-removing-the-last-column-on-flat-table.
Regards,
Solomiia