Asc/Desc tooltip on sorting columns?
Asc/Desc tooltip on sorting columns?
Hello again, I was wondering if there was some way that I could add hover tooltips to the column headers to display what direction the column will be sorted by when clicked, i.e. if it is currently sorted by ascending, the tooltip would say descending and vice-versa, is this possible?
Thanks in advance for your help :)
Thanks in advance for your help :)
This discussion has been closed.
Replies
[code]
$("#resultstab").dataTable({
"bProcessing": true,
"bPaginate": true,
"bLengthChange": true,
"bFilter": false,
"bSort": true,
"bInfo": true,
"bAutoWidth": false,
"sPaginationType": "full_numbers",
"fnDrawCallback": function() {
$('th').each(function(){
if (($(this).hasClass('sorting')) || ($(this).hasClass('sorting_desc'))) {
$(this).attr({title: 'Sort Ascending'});
} else {
$(this).attr({title: 'Sort Descending'});
}
});
}
});
[/code]
Good to hear you found a way to do it - looks like quite a reasonable way to me :-). Thanks for sharing your solution.
Regards,
Allan