sorting images

sorting images

danbuntudanbuntu Posts: 11Questions: 2Answers: 0
edited April 2011 in General
I have a table with fixed headers, sortable columns and a them roller theme.

Some of the columns have images in them and these need to be sortable. I've used the code from the soritng_sType example and I'm sorting on the image title. This works fine in firefox and chrome but in IE I get:

match(...).1 id null or not an object

How do I resolve this please?

Replies

  • allanallan Posts: 63,516Questions: 1Answers: 10,473 Site admin
    Have you set sType to 'string' for the image column? DataTables will strip HTML by default for sorting. However, that shouldn't result in a Javascript error. A link to your example would be very useful.

    Allan
  • danbuntudanbuntu Posts: 11Questions: 2Answers: 0
    I tried 'string' and that worked fine with out the need for the javascript stuff.

    I have a similar problem though with:

    ' . $review2 . '

    $r2colour is a named colour - green, amber, red and $review2 is a number from 1 - 100

    I've tried using string, numeric and html but none of these seems to strip out the html. Instead they are sorting the field by the colour and then the number. i have a owrk arounf though which is not to colour the text and then use a graphic in another coloumn to represent the colour, which then also gives some extra filtering options
  • allanallan Posts: 63,516Questions: 1Answers: 10,473 Site admin
    I think you probably want this plug-in: http://datatables.net/plug-ins/sorting#numbers_html

    Allan
This discussion has been closed.