jQuery UI Widgets Forums Grid Number cast as string in column sorting

Tagged: , , ,

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

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Number cast as string in column sorting #90706

    contreforme
    Participant

    Hello,

    i have these parameters on grid init :

    fields : [{name:”duration”},{…}]
    columns : [{text:”Duration (in minutes)”,datafield:”duration”,width:”30%”,type:”number”},{…}]
    rows : [{“duration” : “85”,…}]

    when I sort the column in ASC or DESC JQXGrid does so in alphabetical order where 9 > 10

    I have tried :
    – removing the quotes as : {“duration” : 85} but then JQXGrid init fails
    – type:”int” or “float” – and/or format:”n” without success

    Thanks for your help
    s.

    Number cast as string in column sorting #90710

    Peter Stoev
    Keymaster

    Hi contreforme,

    1. There is no “type” column property.
    2. This “type” should be set in the datafields initialization.
    3. I would suggest you looking at the Grid’s demos to learn how to correctly initialize the Grid widget.

    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.