Column not sorting with orthogonal data, only on live site

Column not sorting with orthogonal data, only on live site

mrtomtommrtomtom Posts: 7Questions: 4Answers: 0
edited January 2016 in DataTables 1.10

Hi there,

I've got a datable and I'm using orthogonal data to sort a date field with the sort being a unixtimestamp. The data is being drawn from JSON. Everything works great on dev server however on the live site the sort on the date column does not sort. All other columns sort. The other symptom is that there when you click on the sort there is a noticeable pause, that does not exist on the other columns. The JSON is only about 170 rows, and I can't see anything unusual about the data and it's valid JSON.

Currently using 10.10.7, I've put the column definition. Does anyone have any idea how I should go about debugging this? Are there any known possible culprits?

Many thanks!

columns: [
            { "data": "display_id" },
            { "data": "status_name"},
            { "data": "amount" },
            { "data":{
                 "_": "trans_date_human",
                     "sort": "trans_date"
            }
            },
            { "data": "parent_display_id" },
            { "data": "type_name"},
            { "data": "isfor_name" },
            { "data": "payer_name"},
            { "data": "trans_id"},
            { "data": "custom_receipt_no"},
            { "data": "bank_account_name"},
            { "data": "display_id"}
        ],

Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,840Questions: 1Answers: 10,134 Site admin
    Answer ✓

    You probably need to add: "type": "trans_date" since the sorting is based on the detected type - which in this case you want to be the integer.

    Allan

  • mrtomtommrtomtom Posts: 7Questions: 4Answers: 0

    Perfect than

This discussion has been closed.