jQWidgets Forums

jQuery UI Widgets Forums Getting Started Grid sortting date format

This topic contains 5 replies, has 3 voices, and was last updated by  Peter Stoev 9 years, 9 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
  • Grid sortting date format #75486

    Siva
    Participant

    Hi Team,

    In my grid one of the column have date column and the format is ‘Thursday, August 17, 2015 11:02:08 AM’. I want to sort this by column sortting, can you please help?

    Thanks in advance.

    Grid sortting date format #75488

    admin
    Keymaster

    Hi Siva,

    The Date format is not important, because the Grid always sorts by JavaScript Date objects. It internally works only with JavaScript Dates for Date columns. Demo: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/sorting.htm?arctic

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Grid sortting date format #75492

    Siva
    Participant

    Hi,
    I tried this too, but from my side is different. we are getting the timestamp and convert into date as like ‘Thursday, August 17, 2015 11:02:08 AM’. In the date column we marked the datatype field as type: ‘date’ and also the cellformat: ‘yyyy-MM-dd’ or ”dddd, MMMM dd, yyyy h:mm:ss tt’.

    Still my sorting is not working as expected.

    Grid sortting date format #75494

    Peter Stoev
    Keymaster

    Hi Siva,

    Columns do not have type property. source object’s datafields array have. I suggest you to look at the jqxGrid>Data Sources help topic on the Documentation page to learn how to data bind jqxGrid to a data source. There you will find information about Date columns as well.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

    Grid sortting date format #75496

    Siva
    Participant

    hi peter,

    datafields: [
    { name: ‘Date’, type: ‘date’ },
    { name: ‘Freight’, type: ‘float’ },
    { name: ‘ShipName’, type: ‘string’ }
    ]

    columns have ‘type’, this code taken from your example(data source).

    Grid sortting date format #75497

    Peter Stoev
    Keymaster

    Hi Siva,

    Look at the help topic, please. For you data source, it may be necessary to set the “format”, too. If after reading the topic, you still did not solve your problem, then send me a https://www.jseditor.io/ example.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.