not sortable with images inside

not sortable with images inside

berntebernte Posts: 6Questions: 0Answers: 0
edited February 2013 in Bug reports
hi guys... in some fields i have an image for my status.

the problem is that i can't sort a column when there are only images inside.. is it possible to realize that?

here is the demo: http://jsfiddle.net/A5Kr2/ (try to sort "Status")

edit: the jsfiddle runs with 1.9.0. it doesn't work with the latest version on my host

Replies

  • allanallan Posts: 63,381Questions: 1Answers: 10,449 Site admin
    Absolutely it is possible, but you need to tell DataTables how to do the sorting since it strips HTML in the default sort. For that you need a sorting plug-in: http://datatables.net/development/sorting#type_based

    Lots available here: http://datatables.net/plug-ins/sorting - you might be able to customise one for your needs.

    Allan
  • berntebernte Posts: 6Questions: 0Answers: 0
    hi allan.. thanks for your response!

    i don't understand all these examples :(

    why isn't the function included with normal settings like sorting image by alt?
    i'm not an professional and find its very difficult :D
    maybe you can do the standart to the next version :D
  • allanallan Posts: 63,381Questions: 1Answers: 10,449 Site admin
    > why isn't the function included with normal settings like sorting image by alt?

    To try and keep the DataTables core small. You could ask why not all of the plug-ins are just included in the DataTables core. I'm quite strict about making sure that the core size does not grow now :-).

    > maybe you can do the standart to the next version :D

    If this becomes a popular request, then yes, I will consider adding it.

    Allan
This discussion has been closed.