Sort a column having date and normal string,but i need to sort by date

Sort a column having date and normal string,but i need to sort by date

bharathsiva007bharathsiva007 Posts: 5Questions: 2Answers: 0

blackListDoctTable=$('#blacklisted_doctor').DataTable({
        "lengthMenu" : [500, 100, 50, 40, 30, 20, 10 ],
        "aoColumns": [
                    null,
                    null,
                    null,
                    null,
                null,
                null,
                null,
                    {"sType": "date"} 
 ]}); 

The default sorting is not working properly for this column,could u guys pls help me to solve this issue.
thanks in advance.

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @bharathsiva007 ,

    I assume you want this to be date sorted - but you've got non-dates in there which is going to confuse it. You could use orthogonal data in columns.render to return an empty string when "Not disposed off" is present for the ordering. The better solution would be to keep just valid dates in the dates column.

    Cheers,

    Colin

This discussion has been closed.