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

  • Home
  • SEARCH
  • 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 7783439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:50:21+00:00 2026-06-01T19:50:21+00:00

I have a jQgrid column which would show data as in the below example.

  • 0

I have a jQgrid column which would show data as in the below example.

  1. 5 of 10
  2. 2 of 2
  3. 5 of 5
  4. 2 of 10…. etc

    I wanna implement a custom sorting which would sort first based on the number before ‘of’ and then for duplicates it should use the number after the ‘of’.

I have implemented the main sort using the following function.

sorttype: function (cellValue, cellObject) {
                        var sortValueArr = cellValue.split(" ");
                        return parseInt(sortValueArr[0]);
                        //return [parseInt(sortValueArr[0]), parseInt(sortValueArr[2])];
                    }

But am stuck up implementing the secondary-sort-for-duplicates. I tried it with the commented line above. But it is not working.

Please help me out.

The output required is

  1. 2 of 2
  2. 2 of 10
  3. 5 of 5
  4. 5 of 10

Thanks in advance.

  • 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-01T19:50:23+00:00Added an answer on June 1, 2026 at 7:50 pm

    Well, it’s not a pretty answer, but you if you know a hard maximum for the second number, you can run it as a float. For example, if you can be sure that the second number won’t get above, say, 1000, you might use the following

    sorttype: function (cellValue, cellObject)
    {
        var sortValueArr = cellValue.split(" ");
        return (parseFloat(sortValueArr[0]) + parseFloat(sortValueArr[2])/1000);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom, multi-column sort attached to my jqGrid instance by means of
I have a jqgrid that contains some data, the first column of which is
I have a JQGrid populated with data working correctly. The default sorting functionality is
I have a JQGrid which is loading data via AJAX and getting an JSON
Experts, I have JQGrid with custom template column like Edit. the following screen display
I have a custom method for getting a string which is used with jqGrid
In my JQgrid i have a ui atocomplete column which are Case sensitive. For
I have a checkbox column in my JqGrid which get loaded from DB, so
I'm looking for solution which gives ability to disable column sort in jqGrid table
I have jqGrid 3.5 (full) mostly working. I have it retrieving data with the

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.