Question about html inside the .... - How not to include it when sorting?

Question about html inside the .... - How not to include it when sorting?

adinowi3adinowi3 Posts: 2Questions: 0Answers: 0
edited January 2013 in General
Hello.

I have a table set up and it's all great. Really thankfull for this tool. However, I recently tried to add some html code to the data.

I have a header ID, under which I have various IDs (all numerical). For example, let's say in our case it is "72". I would like to add a span around it, to change color of some of the text. So the final version instead "72" would be "72".

However when I do this, all of the html code seems to be included when the tables are deciding on the sorting so these results automatically end up at the end of the list. The question is how do I approach this matter in order for the sorting not to include the html?

Thanks in advance,
Adam.

Replies

  • allanallan Posts: 63,214Questions: 1Answers: 10,415 Site admin
    Sounds like you want the sorting with HTML numbers plug-in: http://datatables.net/plug-ins/sorting#numbers_html

    Unfortunately there was also a bug in 1.9.4 which includes HTML in the filtering :-(. This has been fixed in the repo ( https://github.com/DataTables/DataTables/commit/065c2cc66b872c6964b7d31f12941f23e7f1f171 ) and will be included in the next release.

    Allan
  • adinowi3adinowi3 Posts: 2Questions: 0Answers: 0
    Ok. Thanks for the help with pointing towards the plugin. May I know when can I expect the new version to come out?
  • allanallan Posts: 63,214Questions: 1Answers: 10,415 Site admin
    Should be a beta next month. Or pull in the change from the commit above into your local version - it is a stand alone fix and doesn't require the other changes that have gone in.

    Allan
This discussion has been closed.