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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridComponent scroll issue

Thread ID:





146798 Aug 20,2019 02:32 PM UTC Aug 27,2019 02:18 PM UTC React - EJ 2 3
Tags: Grid
Joao Caetano
Asked On August 20, 2019 02:32 PM UTC

I’m facing an issue using the Syncfusion examples of the GridComponent of React, if added more columns to the table, the horizontal the scrolling appears, which is fine the problem is after scrolling the table to the right, when I try to edit a column the focus comes back to the initial position of the table.
Do you have any suggestions to fix this behaviour?

Attachment: gridcomponent_example_b35d43ea.7z

Balaji Sekar [Syncfusion]
Replied On August 21, 2019 12:38 PM UTC

Hi Joao, 

Thanks for contacting Syncfusion support. 

By default, focus on the first cell of edit form while editing our EJ2 Grid and we suggest you to use the focus the clicked “td” element on editing by using the “actionBegin” and “actionComplete” events. In the “actionBegin” the event we have updated the “focusIndex” with the currently edited cell and in the “actionComplete” we have focused the currently edited cell. Please find the below code example below, 
export class NormalEdit extends SampleBase { 
        constructor() { 
         .     .      .      . 
            this.focusIndex = null; 
        actionBegin(args) { 
            if (args.requestType == "beginEdit") { 
                this.focusIndex = document.activeElement.cellIndex; 
         .     .     .      . 
        actionComplete(args) { 
            if (args.requestType == "beginEdit") { 
                args.row.querySelector('#' + this.gridInstance.element.id + this.gridInstance.columns[this.focusIndex].field).select(); 
        render() { 
            return (<div className='control-pane'> 
                <div className='control-section'> 
                    <div className='col-md-9'> 
                        <GridComponent dataSource={orderDataSource} width={400} actionComplete={this.actionComplete.bind(this)} ref={grid => this.gridInstance = grid} toolbar={this.toolbarOptions} allowPaging={true} editSettings={this.editSettings} pageSettings={this.pageSettings} actionBegin={this.actionBegin.bind(this)}> 
                            <Inject services={[Page, Toolbar, Edit]} /> 
Balaji Sekar. 

Joao Caetano
Replied On August 23, 2019 02:01 PM UTC

Sorry for the late response
I used the code that you sugested on our project and it didn't work
Then I used in the syncfusion example and it didn't work either
Could you suggest anything else?
Best regards

Thavasianand Sankaranarayanan [Syncfusion]
Replied On August 27, 2019 02:18 PM UTC

Hi Joao, 

We can achieve your requirement by using the below way and we have prepared a sample in the following link. 

If you still face the same issue then please reproduce the issue in the above attached sample. 

Thavasianand S. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon