User:Dimpizzy/common.js: Difference between revisions
From Comprehensible Input Wiki
Content deleted Content added
Blanked the page Tag: Blanking |
No edit summary Tag: Reverted |
||
Line 1: | Line 1: | ||
$(document).ready( function () { |
|||
// Create <thead> for DataTables to work |
|||
var header = document.getElementById('library').createTHead().id = 'lib-thead'; |
|||
jQuery('#lib-header').detach().appendTo('#lib-thead'); |
|||
// Activate DataTable |
|||
var waitForDT = setInterval(function () { |
|||
if (typeof $('#library').dataTable === 'function') { |
|||
$('#library2').dataTable( { |
|||
"order": [[ 5, 'desc' ]] |
|||
"columnDefs": [ |
|||
{ "orderData": 4, "targets": 2 } |
|||
] |
|||
} ); |
|||
clearInterval(waitForDT); |
|||
} |
|||
}, 10); |
|||
}); |
Revision as of 21:23, 6 February 2023
$(document).ready( function () {
// Create <thead> for DataTables to work
var header = document.getElementById('library').createTHead().id = 'lib-thead';
jQuery('#lib-header').detach().appendTo('#lib-thead');
// Activate DataTable
var waitForDT = setInterval(function () {
if (typeof $('#library').dataTable === 'function') {
$('#library2').dataTable( {
"order": [[ 5, 'desc' ]]
"columnDefs": [
{ "orderData": 4, "targets": 2 }
]
} );
clearInterval(waitForDT);
}
}, 10);
});