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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:11:47+00:00 2026-05-29T15:11:47+00:00

jqGrid contains action formatter and boolean posted columns. I tried to hide Delete action

  • 0

jqGrid contains action formatter and boolean posted columns.
I tried to hide Delete action button for posted rows in jqGrid in loadComplete using

var iCol = getColumnIndexByName($grid, 'Posted');
$('.ui-inline-del').each(function (index) {
    var row = $grid[0].rows[index];
    if ($(row.cells[iCol]).find(">div>input:checked").length > 0) {
        $(this).hide();
    }
});

but this hides delete action button randomly in wrong rows.
How to remove Delete button from rows where Posted column value is true?
Oleg clickableCheckbox formatter is used in colmodel. Data is read from server in jsin format.

[{"name":"_actions",
"formatter":"actions",
,"delbutton":true,
formatoptions: {"delOptions":{"url":"Delete"}}},

{"label":null,"name":"Posted",
"edittype":"checkbox",
"editoptions":{"value":"True:False","readonly":"readonly","disabled":"disabled"},
"formatter":"clickableCheckbox",
"editable":true,"width":0,
"classes":null,"hidden":true,
}]

Adding new button after delete button

                $("<div>", {
                    title: "Custom",
                    mouseover: function () {
                        $(this).addClass('ui-state-hover');
                    },
                    mouseout: function () {
                        $(this).removeClass('ui-state-hover');
                    },
                    click: function (e) {
                        alert("'Custom' button is clicked in the rowis=" +
                          $(e.target).closest("tr.jqgrow").attr("id") + " !");
                    }
                }
          ).css({ "margin-left": "2px", float: "left" })
           .addClass("ui-pg-div ui-inline-custom")
           .append('<span class="ui-icon ui-icon-lock"></span>')
           .appendTo($(row.cells[iActionsCol]).children("div"));

shows always wrong icon

enter image description here

  • 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-29T15:11:48+00:00Added an answer on May 29, 2026 at 3:11 pm

    I think you should change the enumeration from the loadComplete to something like the following:

    loadComplete: function () {
        var i, rows = this.rows, l = rows.length, row,
            iClosedCol = getColumnIndexByName($grid, 'Posted'),
            iActionsCol = getColumnIndexByName($grid, '_actions');
        for (i = 0; i < l; i++) {
            row = rows[i];
            if ($(row).hasClass('jqgrow')) {
                if ($(row.cells[iClosedCol]).find(">div>input:checked").length > 0) {
                    $(row.cells[iActionsCol]).find(">div>div.ui-inline-del").hide();
                }
            }
        }
    }
    

    In the code you can be sure that you hide the “Delete” action button in exactly the same row where the ‘Posted’ column contains checked checkbox.

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

Sidebar

Related Questions

jqgrid doc in here contains: method allow to reorder the grid columns using the
Inline editing is started using edit formatter action button. If clicked in other row,
jqGrid delete action button is used to delete row. This button click calls Edit
Action buttons are added to jqGrid columns using colmodel below. Column width 45 is
jqGrid contains quantity column and add to cart button using colmodel below. Inline editing
I am using jqgrid. My page has three tabs and each tab contains a
One of my columns contains dates and is sortable. I unsuccessfully tried to use
jqGrid add forms contains autocomplete boxes using code below. If new row is added
jqGrid Edit form invoked using Edit button from top toolbar is defined as grid.navGrid(#grid_toppager,
jqgrid header may contain extra toolbar defined using toolbar: [true, top], contains navigation toolbar

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.