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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:48:54+00:00 2026-06-15T10:48:54+00:00

I need to implement custom sorting in jqGrid, in column we have html markup,

  • 0

I need to implement custom sorting in jqGrid, in column we have html markup, which brakes proper sorting, example:

<a href="/Templates/Article.aspx?id=12884945915" class="link" title="Article  123">Article </a>

Now is there a way to set jqGrid to sort this column ignoring html markup.

update
This is colmodel for this column

{"sortable":true,"name":"Title","index":"Title","hidden":false,"sorttype":null,"formatter":null,"formatoptions":null,"datefmt":null,"typeName":null},

And this is one example of column:

"Title":"<a href='/Templates/Article.aspx?id=4294967489' class='link' title='Sensor'>Sensor</a>"
  • 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-15T10:48:55+00:00Added an answer on June 15, 2026 at 10:48 am

    I suppose that you will don’t have the described problem if you would construct contain of the column with respect of predefined formatter: "showlink" or with respect of your custom formatter. In case of usage custom formatter you should don’t forget to define unformat function which get the text from the cells of the column.

    I suppose that your problem will be solved if you just define unformat property for the column.

    One more alternative option which one has is the usage of custom sorting. It’s nothing more as specifying of sorttype as function. The answer and this one provide examples of such implementation. It’s important to understand that sorttype will be used only in case of local sorting. If you use server side sorting then you should search for the origin of described problem in your server side code.

    UPDATED: It’s not recommended to use HTML fragments inside of data. In the way you mix the data with markup which makes sorting more difficult. Instead of that you could for example replace the input data

    "Title":"<a href='/Templates/Article.aspx?id=4294967489' class='link' title='Sensor'>Sensor</a>"
    

    to

    "ArticleId":4294967489, "Title":"Sensor"
    

    The <a> element inside of the cell you can construct with respect of custom formatter. In the case you could use column definition like

    {name: "Title", width: 100,
        formatter: function (cellvalue, options, rowObject) {
            return "<a href='/Templates/Article.aspx?id=" + rowObject.refid +
                "' class='link' title='" + $.jgrid.stripHtml(cellvalue) + "'>" +
                $.jgrid.htmlEncode(cellvalue) + "</a>";
        }}
    

    If the rowid which you use in the grid (the column with the name id or the column having the property key: true and which values are unique) is the same as ArticleId then you can use options.rowId instead of rowObject.refid.

    You can read more about custom formatter for example in the answer.

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

Sidebar

Related Questions

I need to implement a custom event handler, which should for example handle URIs
As titled. I have a class that implement IComparable which need for sorting. I
I want to implement custom search and have one trouble. I need to combine
I have a situation where i need to implement a custom tree cell renderer.
I've got ArrayList of custom objects. I need to implement sorting by different parametres,
I need to implement a custom Toast which position changes according to other views
I need to implement a custom double tap with time. Example: set to 500ms,
I have JpaAdvertiseCacheRepositoryImpl which is a custom repository implementation of SpringDataJpa. I need this
I need to implement a custom handler for MVC that gives me the first
I need to implement classes to support a custom event capable of passing varying

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.