How to get the plug-in JS file?
How to get the plug-in JS file?
jerry98225
Posts: 10Questions: 0Answers: 0
Hi guys. Sorry for being a noob. I couldn't find the required JS file on this page http://datatables.net/plug-ins/ for plug-ins. Are they available to download on the site? On the sorting link, there is a JS file called "dataTables.numericComma.js". Anyone knows where to find it? Thanks.
This discussion has been closed.
Replies
In the case of the numeric comma sorting plug-in the code is here: http://datatables.net/plug-ins/sorting#numeric_comma . Just copy the code from the page and paste it into a new file. You can then call it whatever you want - dataTables.numericComma.js if you fancy it, or anything else!
Allan
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
"numeric-comma-pre": function ( a ) {
var x = (a == "-") ? 0 : a.replace( /,/, "." );
return parseFloat( x );
},
"numeric-comma-asc": function ( a, b ) {
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
},
"numeric-comma-desc": function ( a, b ) {
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
}
} );
Examples:
http://datatables.net/release-datatables/examples/plug-ins/sorting_plugin.html
http://datatables.net/release-datatables/examples/plug-ins/sorting_sType.html
Allan
After Downloading DataTables-1.9.4 file, i can see error in jquery.js,core.constructor.js files . please can anyone help me