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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:29:43+00:00 2026-05-31T02:29:43+00:00

I have the following grid defined: $(#list).jqGrid({ url:’listOpenQueryInXML.php’, datatype: ‘xml’, colNames:[‘Id’,’name1′, ‘name2’, ‘status’, ‘type’],

  • 0

I have the following grid defined:

$("#list").jqGrid({
    url:'listOpenQueryInXML.php',
    datatype: 'xml',
    colNames:['Id','name1', 'name2', 'status', 'type'],
    colModel:[
        {name:'id', index:'id', editable: false, formatter:'showlink', formatoptions:{baseLinkUrl:'continue.php'}},
        {name:'name1', index:'name1', editable: false},
        {name:'name2', index:'name2', editable: false},
        {name:'status', index:'status', editable: false},
        {name:'type', index:'type', editable: false}
    ],
    autowidth: true,
    sortname: 'id',
    viewrecords: true,
    pager: null,
    sortorder: 'id',
    loadonce: false,
    caption: 'Open Query',
    height: '100%',
    xmlReader: { root : "rows", row: "row", repeatitems: false, id: "id" },

Now, what I would like to have is to override continue.php to be a different link based on the content of ‘id’, or ‘status’ or any field.

So if

status = NEW link=”new.php?id=”{id}”
status = STUCK link=”helper.php?id={id}”

Etc.

I’m running jqGrid 4.3.1 and jQuery 1.8.16.

  • 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-31T02:29:45+00:00Added an answer on May 31, 2026 at 2:29 am

    You should use custom formatter instead of showlink formatter. In the case you have to construct <a> element yourself based on the cellvalue, options and rowObject parameters of the callback function. Because you use datatype: 'xml' the rowObject parameter will be IXMLDOMElement so to get contain of the status you should use find or children jqGrid method.

    I don’t tested the code below, but I suppose you can do something like the following

    $("#list").jqGrid({
        url: 'listOpenQueryInXML.php',
        colNames: ['Id', 'name1', 'name2', 'status', 'type'],
        colModel :[
            {name:'id', formatter: function (cellvalue, options, rowObject) {
                    return '<a href="' +
                               ($(rowObject).children('status').text() === 'NEW' ?
                                   'new.php' : 'helper.php') +
                               '?id=' + cellvalue + '">' + cellvalue + '</a>';
                },
            {name:'name1'},
            {name:'name2'},
            {name:'status'},
            {name:'type'}
        ],
        autowidth: true,
        gridview: true, 
        sortname: 'id',
        viewrecords: true,
        sortorder: 'id',
        caption: 'Open Query',
        height: '100%',
        xmlReader: { repeatitems: false, id: "id" }
    });
    

    Its only an example of the formatter. You can place for example other text in the link which will be displayed the user.

    I removed from the jqGrid definition which you use many default options and added the gridview: true options which improves the performance of the grid.

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

Sidebar

Related Questions

I have defined in XAML a list view, see following fragment: <Grid> <Button Content=_Generate
Suppose I have the following (shortened for simplicity): jQuery(#grid).jqGrid({ ... ondblClickRow: function() { //
I have the following AutoCompleteBox defined inside DataTemplate: <Window.Resources> <DataTemplate x:key=PaneTitleTemplate> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition
I have defined a nested grid view in the following way. <asp:GridView ID=GridView1 runat=server
I have the following Xaml in a Window ( ArtistInfo ): <Grid> <TextBlock Text={Binding
I'm building a grid in ASP.NET MVC and I have the following issue: Above
So I have the following DataTemplate for a ListBox.ItemTemplate : <DataTemplate x:Key=Tweet> <Grid> <Grid.ColumnDefinitions>
I have a class header file called Grid.h that contains the following 2 private
I have the following jQuery code which I'm using to populate a jqGrid. It
I have a simple xaml control with the following Grid Row definition: <Grid.RowDefinitions> <RowDefinition

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.