Filter on span title attribute

Filter on span title attribute

eifachoeppiseifachoeppis Posts: 1Questions: 0Answers: 0
edited May 2011 in General
I have a status column which shows a shortened string. In contains a span element which has the whole string as a title attribute so the user can see it on hover.
Now I want to be able to filter the table based on the title attribute.

For example the content of the cell is [code]This is...[/code] when I now filter for "a test" it finds nothing.

I tried several different data types but none of them filtered the title attribute.

Is there a way to do this?

The strange thing is it works when the title is text and the content is a number.

Replies

  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin
    One option is to set the sType for the column to 'string' - which would result in the whole string being searched on (including the string 'span'). For anything more complex, such as just the title tag, you would need to implement a custom filter, as described here: http://datatables.net/development/filtering

    Allan
This discussion has been closed.