Soting not sorting data cells with links
Soting not sorting data cells with links
Hi, great plugin, have only scratched the surface of it's potential!
I've created a list, very standar two column layout. I've added sorting to the table but when I sort the data in the first column does not sort correctly. IN some of the cells of the first column there are hrefs, and it seems these get added to the top of the list, regardless of what the value within the href is.
At it's most basic here's what's happening, imagine each row is the contents of a table cell in the column
m
a
b
c
d
Is there a filter I have to apply to amke sure it ony reads the contents within the href tag?
Thanks for any help
Euan
I've created a list, very standar two column layout. I've added sorting to the table but when I sort the data in the first column does not sort correctly. IN some of the cells of the first column there are hrefs, and it seems these get added to the top of the list, regardless of what the value within the href is.
At it's most basic here's what's happening, imagine each row is the contents of a table cell in the column
m
a
b
c
d
Is there a filter I have to apply to amke sure it ony reads the contents within the href tag?
Thanks for any help
Euan
This discussion has been closed.
Replies
What you need to do is tell DataTables that that column should strip html tags before sorting. Here is the example: http://datatables.net/examples/example_html_sort.html
One other thing, just from completeness I presume your html should be m?
Allan
Thanks for that, just what I was looking for.
Euan
http://datatables.net/examples/advanced_init/html_sort.html