We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Persist horizontal scroll position after filtering

Hi,

I use a grid with more colums than browser width resulting in a horizonal scroll bar (which is fine).
Now when I scroll to the right and filter data, the horizontal scroll position moves back to the left. In this case the user has to scroll back.

I want to persist (or restore) the horizontal scroll position after filtering.
I have tried this, which didn't work:

<GridComponent
     dataSource={this.state.data} width="100%" height="100%"
     ref={grid => this.grid = grid}
     actionBegin={(args) => this.gridActionBegin(args)}
     actionComplete={(args) => this.gridActionEnd(args)}
.../>



    gridActionBegin(args) {
        if (args.requestType === "filtering") {
            this.scrollLeft = this.grid.getContentTable().parentElement.scrollLeft;
        }
    }

    gridActionEnd(args) {
        if (args.requestType === "filtering") {
            this.grid.getContentTable().parentElement.scrollLeft = this.scrollLeft;
        }
    }

Restoring scrollLeft doesn't work, but the saved value seems to be ok. Now, how can I restore the scroll position so the user hasn't to scroll back?

3 Replies

DR Dhivya Rajendran Syncfusion Team January 29, 2020 05:46 AM

Hi JP, 
  
Thanks for contacting Syncfusion support. 
  
Query : Now when I scroll to the right and filter data, the horizontal scroll position moves back to the left. I want to persist (or restore) the horizontal scroll position after filtering. 
  
We are able to reproduce the reported issue at our end. We have confirmed and logged defect report for the same “Scrolling position is not persisted when filtering the records ( Menu and excel filter type )”. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle ) and including the defect fix in our next patch release which is expected to be rolled out on or before 12th February, 2020 
  
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.  
  
  
Until then we appreciate your patience. 
 
Regards,
R.Dhivya
 



JP JP February 12, 2020 04:01 AM

Hi,

I just tried version 17.4.49 which was released yesterday, but the scrollbar still jumps back to left. Is this fix not included in this release? Or do I have to change something on my end to make this work?
Also, I am not authorized to open this link to the bug you provided.

Regards


BS Balaji Sekar Syncfusion Team February 12, 2020 11:13 PM

Hi Jan Ahnen, 
 
Sorry for the inconvenience caused, 
 
We have some complexities to fix the issue and with more cases, we need to make sure. As we are going to include this fix in our next patch release on 19 February 2020 
 
Until then we appreciate your patience. 
 
Regards, 
Balaji Sekar. 


Loader.
Live Chat Icon For mobile
Up arrow icon