Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Focus shifts to the top of screen on adding item in Grid layout

SA-49745

Summary



Adding an item in a Grid layout, shifts the focus to the top of the screen. Hence, the user has to scroll to the recently added item for filling the details.


Error Messages



Not Applicable.


Steps to Reproduce

  1. Add a repeat grid inside a section
  2. Click the Add Item option in the repeat grid. The item is added at the end of the grid. However, the focus shifts to the top

Root Cause



A defect or configuration issue in the operating environment.



Resolution



Perform the following local-change:
  1. Add the below code snippet in UserWorkForm:

    <script>
    function setFocusToSectionDetails()
    {
    var activeRowIndex=window.Grids.activeGrid.getActiveRowIndex();
    var activeRow=window.Grids.activeGrid.getRow(activeRowIndex)[0];
    var activeRowDetails=activeRow.nextElementSibling;
    activeRowDetails.scrollIntoView();
    //row.querySelector("#pyLabel").focus();
    activeRow.querySelector("td input[autocomplete]").focus();
    }
    </script>

  2. Invoke the above function OnClick of Add Item option of repeat grid



Published March 9, 2018 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us