jQuery UI Widgets Forums Grid Grid column sorting: mixed types

This topic contains 2 replies, has 2 voices, and was last updated by  andy8 10 years, 1 month ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Grid column sorting: mixed types #63037

    andy8
    Participant

    Hi everybody,

    I have a simple, but very annoying issue – cannot properly sort text type columns containing a mix of texts and numbers. The column data type cannot be changed to numbers, because it may also contain text strings. The possible text values are limited only to one string “false”.

    Ideally, when sorting such a column, I would like to get all “false” strings grouped in one place (top or bottom) and all numeric values sorted in descending or ascending order.

    Is it doable somehow?

    Thanks!

    Grid column sorting: mixed types #63040

    Peter Stoev
    Keymaster

    Hello andy8,

    The Grid sorts by your datafield’s type defined in the source object’s initialization. So if it is “string” it will sort by string, if it’s number, it will sort taking into account that the data is numbers. As we know someone may have additional requirements for sorting, we implemented in jqxGrid the option for custom sorting function. Example: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/customsorting.htm?arctic

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Grid column sorting: mixed types #63107

    andy8
    Participant

    Thanks, Peter. It helped a lot.

    Cheers,
    Andy

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

You must be logged in to reply to this topic.