Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jQuery.fn.dataTableExt.oSort['num-html-asc'] = function(a,b) {
- var x = a.replace(/[^0-9]/g, "");
- var y = b.replace(/[^0-9]/g, "");
- x = parseFloat( x );
- y = parseFloat( y );
- return ((x < y || isNaN(y) ) ? -1 : ((x > y || isNaN(x)) ? 1 : 0));
- };
- jQuery.fn.dataTableExt.oSort['num-html-desc'] = function(a,b) {
- var x = a.replace(/[^0-9]/g, "");
- var y = b.replace(/[^0-9]/g, "");
- x = parseFloat( x );
- y = parseFloat( y );
- return ((x < y || isNaN(x)) ? 1 : ((x > y || isNaN(y) ) ? -1 : 0));
- };
- //^ put those after the function dtShowHideCol( iCol )
- //put this inside the $(document).ready(function()
- //before $('.datatable-controls').on(...)
- x = $("#caughtList").dataTable();
- x.fnSettings().aoColumns[6].sType = "num-html";
- x.fnSettings().aoColumns[5].sType = "num-html";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement