Sorting columns with images
Sorting columns with images
Hi,
My question is about sorting a column with an image in it.
I have a table like this:
username | carded | refused | waiting | accepted
USERNAME| Y | N | N | Y
and so on...
I am using images for Y/N bits (small PNG circles like red and green lights)
if I place the image straight in the DataTables doesn't sort that column, even though I have ALT and TITLE attributes exist as (Yes or No)
When I added a hidden span (YES) obviously it works but I don't want to add extra markup as these tables will be generated dynamically and there are LOADS of them.
Any idea is appreciated.
Thanks.
My question is about sorting a column with an image in it.
I have a table like this:
username | carded | refused | waiting | accepted
USERNAME| Y | N | N | Y
and so on...
I am using images for Y/N bits (small PNG circles like red and green lights)
if I place the image straight in the DataTables doesn't sort that column, even though I have ALT and TITLE attributes exist as (Yes or No)
When I added a hidden span (YES) obviously it works but I don't want to add extra markup as these tables will be generated dynamically and there are LOADS of them.
Any idea is appreciated.
Thanks.
This discussion has been closed.
Replies
http://www.datatables.net/usage/columns#sType
it was probably auto-detecting 'html' type, which strips/ignores the html
[code]
"aoColumnDefs": [
{ "sType": "string", "aTargets": [ 0 ] }
]
[/code]