Odd Sorting Behaviour
Odd Sorting Behaviour
topherfangio
Posts: 2Questions: 0Answers: 0
Hello all,
I've been using DataTables for about two months now, and it has really helped our application become more user friendly. Our clients love it! However, I've run into an interesting problem, and I couldn't seem to find out any information about it using the search available on this site. So, on to the problem:
I have enabled the default sorting on all of the columns in my table. This works really well except for the case of the first column which contains a person's name in the form of "Last, First". For some reason, its sorting based on the first name instead of the last name. Does anyone know why it is doing this and/or an easy way to change it?
I've been using DataTables for about two months now, and it has really helped our application become more user friendly. Our clients love it! However, I've run into an interesting problem, and I couldn't seem to find out any information about it using the search available on this site. So, on to the problem:
I have enabled the default sorting on all of the columns in my table. This works really well except for the case of the first column which contains a person's name in the form of "Last, First". For some reason, its sorting based on the first name instead of the last name. Does anyone know why it is doing this and/or an easy way to change it?
This discussion has been closed.
Replies
Allan
[code]
jQuery.fn.dataTableExt.aTypes.push(
function ( sData ) {
return 'html';
}
);
[/code]
Thanks for the help, and sorry to have bothered you with such a simple question :-)
Hope this saves someone else some trouble.
Edit: For reference, I found the above information at http://www.datatables.net/plug-ins/type-detection under "HTML auto detection".