Column natural sort does not work if cells have hyper links

Column natural sort does not work if cells have hyper links

derekwallacederekwallace Posts: 11Questions: 0Answers: 0
edited April 2015 in Free community support

Hi,
I have cells that have hyperlinks.

<td><a href='Could be anything'>SortThisString</a></td>

Im using the natural sort plugin.

  var table = $('#example').DataTable(
  {
    "columnDefs"  : [{ type: 'natural', targets: '_all' }]
    
  }

However the sorting is not correct.
What i believe is happening is that the html element code is being used as part of the sort.
Since the href value is before the display value, it is the thing that takes priority
in the sort.

Example of problem here.
http://live.datatables.net/zuxevobe/4/edit

Thx
derek

Replies

This discussion has been closed.