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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:14:34+00:00 2026-06-16T05:14:34+00:00

I have a JQgrid which contains has just 2 columns..I am pasting my code

  • 0

I have a JQgrid which contains has just 2 columns..I am pasting my code which i have tried below..

var UserArr = new Array();
function Grid()
{
$("#users_grid").jqGrid({

            colNames: ['Site_Name', 'Details'],
            colModel: [{ name: 'Site_Name', index: 'Site_Name', width: 130,editable: false, sortable: false,formatter: 'showlink', formatoptions: { baseLinkUrl: 'url of respective site i have clicked'}},
            { name: 'Details', index: 'Details', width: 400, editable: false, sortable: false }],

            width: 400,
            height: 'auto',
            multiselect: true

        });

        var postJSONData = JSON.stringify({ 'parentitem': parent,'childitem':child });

         $.ajax({
            type: 'POST',
            data: postJSONData,
            url: 'ManageAssetService.asmx/DisplayGridData',
            dataType: 'json',
            async: false,
            contentType: 'application/json; charset=utf-8',
            success: function success(response) {

                UserArr = response.d;

            },
            error: function failure(response) {
            alert(response.message);
                alert('failed to fetch user details');
            }
        });

         var mydata;

         for (var i = 0; i <5; i++) {

             mydata = {};

            mydata.Url= UserArr[i].Url;
            mydata.Details= UserArr[i].Details;

            $("#users_grid").jqGrid('addRowData', 'GridData_Row_' + (i + 1), mydata);


        }
}

I will display the site name and some details about that in the JQgrid.. Now the Site_Name will be an hyperlink when i click that it should redirect to the respective url.. How could i achieve that..Moreover i am adding the grid data dynamically..so where should i give the respective url for the Site_Name column data and how could i link it with that..

Please help..

  • 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-16T05:14:35+00:00Added an answer on June 16, 2026 at 5:14 am

    I have got my solution like this..

    The JQgrid column shold be defined like this:

    colNames: ['Site_Name', 'Details'],
                colModel: [{ name: 'Site_Name', index: 'Site_Name', width: 130,editable: false, sortable: false,formatter: 'showlink', formatoptions: { baseLinkUrl: 'javascript:', showAction: "Link('", addParam: "');"} },
                { name: 'Details', index: 'Details', width: 400, editable: false, sortable: false }],
    

    The Javascript function:

    function Link(id) {
    
        var row = id.split("=");
        var row_ID = row[1];
        var sitename= $("#users_grid").getCell(row_ID, 'Site_Name');
        var url = "http://"+sitename; // sitename will be like google.com or yahoo.com
    
        window.open(url);
    
    
    }
    

    Thats it..

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

Sidebar

Related Questions

I have a jqgrid , which has multiple columns and rows, all of which
I have the following jQuery code which I'm using to populate a jqGrid. It
I have a jqGrid which contains folders and documents. I want to be able
I have bunch of hidden columns in my jqGrid, on which I want to
I have a jqGrid with four columns and in which i get the rows
I have a JQGrid which has add/edit form functionality enabled. Both are working fine.
I have the below jqgrid image, from which I would like to remove the
I have a jqGrid which has a column called Actions. In this column, each
I am trying to format a jqgrid which has some dynamic columns which I
I have a mvc3 web application which uses jqgrid extensively. I just came to

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.