Sorting by html tags ( ) - first tags, then value

Sorting by html tags ( ) - first tags, then value

kodingerkodinger Posts: 3Questions: 0Answers: 0
edited February 2010 in General
Hello,

I want to sort my table after a column, in which text can be normally or boldly written. Is it possible to sort this column firstly by the tag and then by the value of the column??

Replies

  • allanallan Posts: 63,214Questions: 1Answers: 10,415 Site admin
    Actually - DataTables will sort using the HTML tags by default! You need to tell it to strip HTML tags if that is what you want - see this demo: http://datatables.net/examples/advanced_init/html_sort.html

    So it should already do what you are looking for. Is it not?

    Allan
  • kodingerkodinger Posts: 3Questions: 0Answers: 0
    no it sadly isn't that what im looking for..
    i have a table with some kind of messages.. when they are unread, they are boldy written, if read, normally written. if i sort them, they shall be sorted by unread, then read and then by their value..

    is it possible to realise sth like this?
  • allanallan Posts: 63,214Questions: 1Answers: 10,415 Site admin
    As I mentioned - DataTables will sort with HTML tags included in the string by default. So if this sort isn't working for you (a link showing an example would be very useful) then you might need to implement a custom sort: http://datatables.net/development/sorting . The plug-ins pages has several examples as well.

    Allan
This discussion has been closed.