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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T15:21:41+00:00 2026-05-20T15:21:41+00:00

I love jqGrid but sometimes things seem more complicated than they should be. What

  • 0

I love jqGrid but sometimes things seem more complicated than they should be.
What I would like to achieve is to have a checkbox on each row so that a user can choose which rows are going to be submitted/processed.
I need, though, to block some checkboxes cause the user has no authorization on that particular row, maybe.

I’ve tried to set multiselect: true and then I’ve tried to hide the checkbox:

loadComplete: function (data) {
    if (data.rows.length > 0) {
        for (var i = 0; i < data.rows.length; i++) {
            if (data.rows[i].cell[7] == 'false') {
                $("#jqg_OrdersGrid_" + data.rows[i].id).css("visibility", "hidden");
            }
        }
    }
},

and it works well but, still, .jqGrid('getGridParam', 'selarrrow') give me the selected rows, even if they haven’t been checked.
Is there any other way to have checkboxes which are enabled/disabled and a way to know which ones have been checked?

thanks

  • 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-20T15:21:41+00:00Added an answer on May 20, 2026 at 3:21 pm

    I would suggest you to disable some checkboxed from the be selectable with respect of “disabled” attribute. To make full implementation you will need

    1. set “disabled” inside of loadComplete event handle
    2. additionally prevent selection of disabled rows inside beforeSelectRow event handle
    3. to have support of “select all” checkbox in the header of the multiselect column implement onSelectAll event handle which fix selection of disabled rows.

    The corresponding demo can you see here. The most important part of the code is here:

    var grid = $("#list10"), i;
    grid.jqGrid({
        //...
        loadComplete: function() {
            // we make all even rows "protected", so that will be not selectable
            var cbs = $("tr.jqgrow > td > input.cbox:even", grid[0]);
            cbs.attr("disabled", "disabled");
        },
        beforeSelectRow: function(rowid, e) {
            var cbsdis = $("tr#"+rowid+".jqgrow > td > input.cbox:disabled", grid[0]);
            if (cbsdis.length === 0) {
                return true;    // allow select the row
            } else {
                return false;   // not allow select the row
            }
        },
        onSelectAll: function(aRowids,status) {
            if (status) {
                // uncheck "protected" rows
                var cbs = $("tr.jqgrow > td > input.cbox:disabled", grid[0]);
                cbs.removeAttr("checked");
    
                //modify the selarrrow parameter
                grid[0].p.selarrrow = grid.find("tr.jqgrow:has(td > input.cbox:checked)")
                    .map(function() { return this.id; }) // convert to set of ids
                    .get(); // convert to instance of Array
            }
        }
    );
    

    UPDATED: Free jqGrid supports hasMultiselectCheckBox callback, which can be used to create multiselect checkboxes not for all rows of jqGrid. One can use rowattr to disable some rows additionally. As the result one will get the described above functionality in more simple way. It’s recommended to use multiPageSelection: true option additionally for free jqGrid with local data (datatype: "local" or loadonce: true). The option multiPageSelection: true will hold the array selarrrow on paging. It allows “pre-select” some rows by filling the corresponding ids inselarrrow. See UPDATED part of the answer and the answer with the demo for additional information.

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

Sidebar

Related Questions

I love paredit. But there are a couple of things I hate, and have
I love using Haml helpers, but over the years things have changed a bit.
I love the Intellij IDEA but i have been stacked on one little problem
I love vim and the speed it gives me. But sometimes, my fingers are
I love Bootstrap but one annoyance that I can't seem to get my hands
I love KnockoutJS but have been struggling to figure out the best way to
Would love to have a keyboard shortcut that get's the latest for a solution
Love the JQuery Treewiev plugin http://bassistance.de/jquery-plugins/jquery-plugin-treeview/ , but I have one problem with it.
I love using Guava's Iterables filters. But one common code snippet looks like: List
I love text mate, but sometimes I do miss some IDE features. One of

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.