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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:14:18+00:00 2026-05-23T17:14:18+00:00

I am trying to add a button inside a jqGrid column and to assign

  • 0

I am trying to add a button inside a jqGrid column and to assign it an action related to an element of the grid. Here is my grid definition (I will only concentrate on things important for the question)

$("#dashboard").jqGrid({
    url: wsBaseUrl + 'xxxxxxxx',
    colNames: ['col1', 'col2', 'col3', 'Actions'],
    colModel: [
        { name: 'col1', index: 'col1', formatter: statusFormatter },
        { name: 'col2', index: 'col2', formatter: statusFormatter },
        { name: 'col3', index: 'col3', formatter: statusFormatter },
        { name: 'act', index: 'act', width: 46, sortable: false, search: false,
            formatter: function () {
                var cnt = "<a class='pc_link' href='#'>Perimeter Change list</a>" +
                    "<a class='nopc_Link' href='#'>NO perimeter change </a>";
                return cnt;
            }}
    ],
    jsonReader: {
        id: "elementID"
    },
    pager: $('#dashboard_pager'),

    // ... other params omitted for brevity

    gridComplete: function () {
        $(".pc_Link").button({
            icons: { primary: "ui-icon-folder-open" }, text: false
        });
        $(".nopc_Link").button({
            icons: { primary: "ui-icon-star" }, text: false
        });
    },
    subGrid: true,

    // ... other params omitted for brevity

});

As you can see I have a column in my colModel definition that act as an Action Column: that is, I create two hyperlinks in this column that shall be binded to a click event and react accordingly.

After that I have a gridComplete() event where I plan to bind the click event.

What I need is a way to set the rel attribute of the hyperlink with the value of the current rowObject ID so I can retrieve it when making the call. Like in the following example:

<a class='pc_link' href='#' rel='123'>Perimeter Change list</a>

Is there a way to obtain this?

thanks for helping!

  • 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-23T17:14:19+00:00Added an answer on May 23, 2026 at 5:14 pm

    the formatter function accepts a parameter representing the row data (rowObject).
    see custom formatter.

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

Sidebar

Related Questions

I am trying to add bootstrap drop down button in a column of jqGrid
I am trying to add Alert Builder Inside a BaseAdapter under button clicked. Here
I am trying to add Become-a-Fan button to my 2008 asp.net website (vb) Here
Im am trying to add a check box that will enable/disable the edit button.
hi I'm trying to add to button inside an info window an event i
I'm trying to add a reply button inside the post, for example if I
I am trying to add events on my buttons inside a list, but it
I'm trying to add an AirPlay button to my app and used the following
I am trying to add a pinterest button to a control. I am trying
I'm trying to add a custom button to the button panel of jQuery's datepicker.

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.