We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It's currently only possible in the main view
The text was updated successfully, but these errors were encountered:
@QuentinFchx OK I marked this as an enhancement, I will merge this in if anyone can do the work and create a PR!
Sorry, something went wrong.
Before this will be merged.
Just open console and run
const dataTablesScript = document.createElement('script'); dataTablesScript.src = "https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"; dataTablesScript.onload = function () { jQuery.fn.dataTable.ext.type.order["file-size-pre"] = function ( data ) { var matches = data.match( /^(\d+(?:\.\d+)?)\s*([a-z]+)/i ); var multipliers = { b: 1, bytes: 1, kb: 1000, kib: 1024, mb: 1000000, mib: 1048576, gb: 1000000000, gib: 1073741824, tb: 1000000000000, tib: 1099511627776, pb: 1000000000000000, pib: 1125899906842624 }; if (matches) { var multiplier = multipliers[matches[2].toLowerCase()]; return parseFloat( matches[1] ) * multiplier; } else { return -1; }; }; $('.table').eq(1).DataTable({ columnDefs: [ { type: "file-size", targets: 2 }, { className: "sortable-th size-th", targets: [ 2 ] } ], order: [[ 2, "desc" ]], paging: false, searching: false, }); }; document.body.appendChild(dataTablesScript);
No branches or pull requests
It's currently only possible in the main view
The text was updated successfully, but these errors were encountered: