Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 708567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:24:20+00:00 2026-05-14T04:24:20+00:00

I have a jqGrid on a page and users can click a button to

  • 0

I have a jqGrid on a page and users can click a button to add a new row. If there are already enough rows on the page to fill the visible portion of the grid the new row is added and a scroll bar appears but the user needs to scroll to see the new row.

Is there a way to do this programmatically?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:24:20+00:00Added an answer on May 14, 2026 at 4:24 am

    A quick and easy way to do this using the jqGrid API is to:

    • Call editRow (which will set focus to the edited row)
    • And then immediately call restoreRow (because you do not really want to edit the row)

    Otherwise you should be able to use jQuery’s focus function to set focus to the row, for example: jQuery("#" + row_id).focus() – but I have not tested this method, so YMMV.

    Actually focus will not scroll the grid’s div. But you can use the following code to guarantee that the grid scrolls such that the row with a given id is viewable:

    function getGridRowHeight (targetGrid) {
        var height = null; // Default
    
        try{
            height = jQuery(targetGrid).find('tbody').find('tr:first').outerHeight();
        }
        catch(e){
         //catch and just suppress error
        }
    
        return height;
    }
    
    function scrollToRow (targetGrid, id) {
        var rowHeight = getGridRowHeight(targetGrid) || 23; // Default height
        var index = jQuery(targetGrid).getInd(id);
        jQuery(targetGrid).closest(".ui-jqgrid-bdiv").scrollTop(rowHeight * index);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a jqgrid and when i double click a row, i call jquery
For jqgrid, you can supply a caption. If you do so, it creates a
I have a jqGrid displaying the data in the table correctly and on gridComplete
I have a jqGrid with multiselect. I would like to be able to pre-check
i have a jqgrid, and i am using the popup editor to edit the
i am using Jqgrid http://trirand.com/blog its a very good grid solution, the linked one
JSON As generated by Spring 3 MVC @ResponseBody { total: 1, page: 1, records:
After reading up on the JQGrid control, I decided it would be good to
I am following Phil Haacks tutorial on using JQGrid with ASP.Net MVC. My application
the below code creates a javascript object, converts it to JSON, and attempts to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.