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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T19:59:42+00:00 2026-05-16T19:59:42+00:00

I’ve been working with JQGrid a lot, and would recommend it to everyone. The

  • 0

I’ve been working with JQGrid a lot, and would recommend it to everyone.
The one feature I don’t really like is the built in multiselect which doesnt use special keys like shift and ctrl, doesnt give you much control and forces checkboxes to be shown.

I would like to implement my own multiselect as follows:
In onSelectRow- check if shift or ctrl is held add the row id to an array and select it in the grid. if none are held, clear the array and add the new row id and select it in the grid.

This is simple enough to implement, except i need an event in the onSelectRow to check if the keys are held. I would prefer not to attach a keydown and keyup event on the main document itself.

onSelectRow: function (id) {
            event=???
            if (!event.shiftKey && !event.ctrlKey) {

            }
            else {

            }
}

Regards,
Byron Cobb.

EDIT: Solution –

Following Olegs input, I have done the following.

  1. Set multiselect: true in the grid definition
  2. Hidden the checkbox column in gridComplete by setting $("#myGrid").jqGrid('hideCol', 'cb');
  3. Checked for the ctrl key myself(not using multikey:”ctrlKey”) before the select and clearing the selection if no ctrl key is pressed.
  4. Later using the selection array when needed – var SelectedRows = $("#myGrid").jqGrid('getGridParam', 'selarrrow');

beforeSelectRow: function (rowid, e) {
            if (!e.ctrlKey) {
                $("#myGrid").resetSelection();
            }
            return true;
        },
  • 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-16T19:59:42+00:00Added an answer on May 16, 2026 at 7:59 pm

    Since the version 3.5.3 jqGrid support beforeSelectRow event which has event which you need and which will be called before onSelectRow.

    Probably the usage of multikey option of jqGrid and hiding of the pseudo-column with the name “cb”

    $("#mygrid").jqGrid('hideCol','cb');
    

    (cb – combo-boxes, see http://www.trirand.com/blog/?page_id=393/help/multiselect-without-checkboxes-1/) will help you to implement in jqGrid the behavior of row selection which you want.

    UPDATED: I suppose you also know that $("#mygrid").jqGrid('getGridParam','selarrrow') can be used to get the array of ids of all currently selected rows, but to be sure I insert the information also.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I would like to run a str_replace or preg_replace which looks for certain words
I would like to count the length of a string with PHP. The string
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I've got a string that has curly quotes in it. I'd like to replace
I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:

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.