PHP echo makes table sort not work
PHP echo makes table sort not work
We populate our DataTable with php files that display data that has been recorded. If you click on this page you will understand (the right column displays 'clicks by popularity').
https://www.concise-courses.com/hacking-tools/d.php
This right hand side column is populated by php strings that pull data regarding the amount of time a link has been clicked. We would like for that data to be sorted.....
The php/ javascript string that does this in each row is here:
ccount_display('windbg')Do you think that there is a compatibility problem here? Can't the DataTables javascript read the php?
Thanks -
Answers
have you got a code snippet ?
Thanks for the link. The problem is this:
DataTables will strip the HTML tags, but that leaves:
Which is not a number and hence it can't be sorted as such.
I think the best bet here would be to use HTML5 orthogonal data. So for example make your HTML for that column:
i.e. same as before but add
data-order
anddata-type
so DataTables will use the number for type detection and ordering.Allan
Thanks Allan - as soon as I have an update on this I can update this thread too!