jQWidgets Forums

jQuery UI Widgets Forums Grid Custom sort for numbers and strings in the same column

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 9 years, 4 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author

  • kamelot
    Participant

    Hi,

    I have a IPs, Hostnames, URLs in the same column. When I use jqxgrid default sort, the IPs are being sorted like string, for example (notice all the 1’s first, then all the 2’s etc):

    1.1.1.1
    103.1.1.1
    104.1.1.1
    2.10.1.1
    20.2.2.2
    202.223.245.256
    30.1.1.100
    300.1.1.0
    69.17.21.194
    abc.com
    cde.net
    zzzz.com

    I would like to sort the IPs like NUMBERS and not as string, but for the URLs, Hostnames still regular string sort.
    How would I go to achieve this in the custom sort?

    Side note: In my custom sort, I tried convert the ips into number, but it didn’t do any justice. All the URL, hostnames are looking good, but IPs didn’t get to sort or anything, and they’re mixed up between the actual strings.


    Peter Stoev
    Keymaster

    Hi kamelot,

    You will need to implement custom sorting in your case.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.