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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:26:28+00:00 2026-06-01T00:26:28+00:00

I have this jqgrid definition and I’m trying to open the selected document in

  • 0

I have this jqgrid definition and I’m trying to open the selected document in a new Window.

My final urls should like these:

http://localhost/XPagesSortableSearchResults.nsf/xPerson.xsp?documentId=9D93E80306A7AA88802572580072717A&action=openDocument

and also I need to generate this type of url:

http://localhost/XPagesSortableSearchResults.nsf/$$OpenDominoDocument.xsp?documentId=9D93E80306A7AA88802572580072717&action=openDocument


$().ready(function(){
jQuery("#list2").jqGrid({
        url:'./xGrid7.xsp/peoplejson',
        datatype: "json",
        colNames:['InternetAddress','#','Name','OfficeCountry'],
        colModel:[                              
            {name:'InternetAddress',index:'InternetAddress', width:200},
            {name:'@position',index:'@position', width:50,sorttype:'int'},
            {name:'$17',index:'$17', width:200},
            {name:'OfficeCountry',
                   width:200,
                   formatter:editLinkFmatter
                  // formatter:'showlink',
                  // formatoptions:{ baseLinkUrl:'xPerson.xsp',addParam: '&action=openDocument', idName:'documentId'}
            }
        ],
        jsonReader: {
            repeatitems: false,
            id: '@unid',
            root: function (obj) {
                  if ($.isArray(obj)) {
                       return obj;
                  }
                  if ($.isArray(obj.items)) {
                    return obj.items;
                  }
                  return [];
                     },
             page: function () { return 1; },
             total: function () { return 1; },
             records: function (obj) {
                    if ($.isArray(obj)) {
                        return obj.length;
                    }
                    if ($.isArray(obj.items)) {
                        return obj.items.length;
                    }
                    return 0;
            }
        },
        caption: "JSON Example",
        height: 500,
        gridview: true,
        loadonce: true,
        ignoreCase: true,
        rowNum: 50, 
        rowList: [50, 100, 500, 1000],
        pager: '#pager2'
        }).jqGrid('filterToolbar', {stringResult: true, defaultSearch: 'cn', searchOnEnter: false});

Note my Json object looks like this and I’m not using the documentId I need on my url as part of my ColModel; the value I need is @unid

        [
      {
          "@entryid":"1-B933790B1DC265ED8025725800728CC5",
          "@unid":"B933790B1DC265ED8025725800728CC5",
          "@noteid":"1E76E",
          "@position":"1",
          "@read":true,
          "@siblings":40000,
          "@form":"Person",
          "$17":"Aaron, Adam",
          "InternetAddress":"consurgo@compleo.net",
          "OfficeCountry":"Namibia"
      },
      {
          "@entryid":"2-9D93E80306A7AA88802572580072717A",
          "@unid":"9D93E80306A7AA88802572580072717A",
          "@noteid":"19376",
          "@position":"2",
          "@read":true,
          "@siblings":40000,
          "@form":"Person",
          "$17":"Aaron, Dave",
          "InternetAddress":"gratia@incito.co.uk",
          "OfficeCountry":"Brazil"
      },
      {
          "@entryid":"3-FAFA753960DB587A80257258007287CF",
          "@unid":"FAFA753960DB587A80257258007287CF",
          "@noteid":"1D842",
          "@position":"3",
          "@read":true,
          "@siblings":40000,
          "@form":"Person",
          "$17":"Aaron, Donnie",
          "InternetAddress":"vociferor@nequities.net",
          "OfficeCountry":"Algeria"
      }
]

So far I make it work using:

  {name:'OfficeCountry',
               width:200,                                      
               formatter:'showlink',
               formatoptions:{ baseLinkUrl:'xPerson.xsp',addParam: '&action=openDocument', idName:'documentId'}
    }

but I need to open it in a new window

I also tried with formatter:editLinkFmatter

function editLinkFmatter(cellvalue, options, rowObject) {
    return "<a href='./" + rowObject[2] + "' class='requestlink'>" + cellvalue + "</a>";
    //return "<a href='./documentId=" + rowObject.@unid + "' >Click here</a>";
    //return "<a href='./documentId=" + options.idName + "&action=OpenDocument'>" + cellvalue + "</a>";
}

and I can’t use rowObject.@unid because the node name

  • 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-01T00:26:29+00:00Added an answer on June 1, 2026 at 12:26 am

    It seems to me that you should just use target="_blank"attribute in the <a> (see here and here). The standard ‘showlink’ formatter supports target attribute.

    As the alternative to the custom formatter you can use ‘dynamicLink’ formatter (see the answer). You can download the last version of jQuery.jqGrid.dynamicLink.js from here.

    UPDATED: To assess the property with the name @unid you can use syntax rowObject["@unid"]. So the editLinkFmatter can be like

    function editLinkFmatter(cellvalue, options, rowObject) {
        return "<a href='?documentId=" + rowObject["@unid"] +
            "&action=OpenDocument' class='requestlink'>" + cellvalue + "</a>";
    }
    

    or better like

    function editLinkFmatter(cellvalue, options, rowObject) {
        return "<a href='?" +
            $.param({
                documentId: rowObject["@unid"],
                action: 'OpenDocument'
            }) + "' class='requestlink'>" + cellvalue + "</a>";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a few events set up like this: $('#grid').jqGrid('saveRow', lastsel, { aftersavefunc: function
I have this mysql tables I want to display with jqgrid. The problem appears
I wondered if someone might have some insight into this. jqGrid is quite happy
In my jqgrid when i am clicking on add new record i have date
I am trying to use the JQGrid plugin and have run into an issue
I have been struggling quite a bit to get this JQgrid to work with
I'm just playing around with jqGrid this afternoon, and have it working fairly well
I have this jqGrid: $(#report).jqGrid( { url: '/py/db?coll=report', datatype: 'json', height: 250, colNames: ['ACN',
I have seen this code Sortable JqGrid using LINQ to MySQL (DbLinq) and Dynamic
I have an html page with jqgrid. This jqgrid retrieve data from a php

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.