Sorting FileSizes
Sorting FileSizes
JPBCDE
Posts: 11Questions: 0Answers: 0
I need help please. Im trying to sort a column that contains file sized in KB, MB, GB. I've searched this site and the plugins and tried putting something together, but it still seems to sort as text. Any help would be appreciated.
Test site : http://live.datatables.net/utirij/edit#javascript,html,live
I started with this thread : http://www.datatables.net/forums/discussion/2517/solved-sorting-a-table-column/p1
Thank you
Test site : http://live.datatables.net/utirij/edit#javascript,html,live
I started with this thread : http://www.datatables.net/forums/discussion/2517/solved-sorting-a-table-column/p1
Thank you
This discussion has been closed.
Replies
$(document).ready(function() {
$('#trafficreport').dataTable({
"bJQueryUI": true,
"sDom": '<"H"Tfr>t<"F"ip>',
"oTableTools": {
"sSwfPath": "/js/swf/copy_cvs_xls_pdf.swf",
"aButtons": [
"copy",
"csv",
{
"sExtends": "print",
"sMessage": "Traffic ReportStart Date: 2011/11/01
End Date: 2011/11/30
",
"bShowAll": true
}
]
},
"sPaginationType": "full_numbers",
"bLengthChange": true,
"iDisplayLength": 10000,
"bSort": true,
"bDestroy": true,
"bAutoWidth": false,
"aoColumns" : [
{ sWidth : "5%" },
{ sWidth : "40%" },
{ sWidth : "40%"},
{ sWidth : "15%", "sType": "file-size" }
]
});
});
http://live.datatables.net/utirij/3/edit
The error was here :
{ sWidth : "5%" },
{ sWidth : "40%" },
{ sWidth : "40%", "sType": "file-size" },
{ sWidth : "15%"}
is this the correct code :
{ sWidth : "5%" },
{ sWidth : "40%" },
{ sWidth : "40%"},
{ sWidth : "15%", "sType": "file-size" }
Sorry i missed what you did. I see now, thank you so much :)