Created
April 2, 2014 14:21
-
-
Save ezrabrook/9935133 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.extend(jQuery.fn.dataTableExt.oSort, { | |
"currency-pre" : function(a) { | |
a = (a === "-") ? 0 : a.replace(/[^\d\-\.]/g, ""); | |
return parseFloat(a); | |
}, | |
"currency-asc" : function(a, b) { | |
return a - b; | |
}, | |
"currency-desc" : function(a, b) { | |
return b - a; | |
} | |
}); | |
//Once doc has loaded, sort table .. price by default | |
jQuery(document).ready(function() { | |
jQuery('.product-table').dataTable({ | |
"aoColumns" : | |
[null, | |
{"sType" : "currency"}, | |
{"sType" : "currency"}, | |
null, | |
{"bSortable" : false} | |
], | |
"aaSorting" : [[0, 'asc']], | |
//"aaSorting" : [], | |
"bPaginate" : false, | |
"bLengthChange" : false, | |
"bFilter" : true, | |
"bSort" : true, | |
"bInfo" : false, | |
"bAutoWidth" : false, | |
"sDom": '<"top"f>rt<"bottom"><"clear">', | |
"oLanguage": { | |
"sSearch": "Looking for a specific product? " | |
} | |
}); | |
}); | |
jQuery(document).ready(function() { | |
jQuery('.product-table-search').dataTable({ | |
"aoColumns" : | |
[null, | |
null, | |
{"sType" : "currency"}, | |
null, | |
{"bSortable" : false} | |
], | |
//"aaSorting" : [[1, 'asc']], | |
"aaSorting" : [], | |
"bPaginate" : false, | |
"bLengthChange" : false, | |
"bFilter" : true, | |
"bSort" : true, | |
"bInfo" : false, | |
"bAutoWidth" : false, | |
"sDom": '<"top"f>rt<"bottom"><"clear">', | |
"oLanguage": { | |
"sSearch": "Looking for a specific product? " | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment