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 8265947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:58:45+00:00 2026-06-08T04:58:45+00:00

Simple question, hard to find an answer: If I try to select a row

  • 0

Simple question, hard to find an answer:

If I try to select a row programmatically, I use this:

$('#grid').jqGrid('setSelection', rowId);

The problem is that it only selects rows on current visible page. If rowId is on another page, it will not be selected.

More info: My goal is to select multiple rows (spread on multiple pages) when page loads for the first time.

Thanks,
Rafael

PS: This guy has the same problem. No answer yet:
jqgrid multiselect only selects rows on the current page, if paging is enabled. How to make it select rows across pages?

  • 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-06-08T04:58:46+00:00Added an answer on June 8, 2026 at 4:58 am

    Right, jqGrid will only select rows on the current page. In order to select other rows you need to maintain a list of selected ID’s and manually select them.

    To do this you need to add code to your loadComplete event to search the current page and select any of these rows:

    var ids = grid.jqGrid('getDataIDs');
    for (var i = 0; i < ids.length; i++){
        if (selected[ids[i]] === true ){
            grid.setSelection(ids[i], false);
        }
    }
    

    You also need to add code to your onSelectRow and onSelectAll events to adjust the contents of selected when the user selects/unselects rows:

    onSelectRow: function(rowid, status){
        selected[rowid] = status;
        setSelectedDeviceCount();
    },
    
    onSelectAll: function(rowids, status){
        for (var i = 0; i < rowids.length; i++){
            selected[rowids[i]] = status;
        }
    }
    

    Does that help?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Pretty simple question, hard to find an answer: I want to Serialize in JSON
This might be a simple question for some people since it was quite hard
Simple question, could'nt find a straight answer. How can I modify the output file
I couldn't find a good, clear question and answer for this in StackExchange, so
This is probably a question that has an easy/simple/obvious answer, but I've found myself
This is probably a simple question but I'm having a hard time trying to
My question is pretty simple, but I am having a hard time finding any
This question's solution makes hard-coded transformation of a sample XML tree into a flat
Simple question, (Easy points!) In Delphi 2010 (with updates 4 and 5) Find in
My question is simple, but I haven't been able to find the question anywhere.

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.