MediaWiki:Datatables custom.js: Difference between revisions
From Comprehensible Input Wiki
Content added Content deleted
No edit summary Tag: Reverted |
No edit summary Tag: Manual revert |
||
Line 4: | Line 4: | ||
var header = document.getElementById('library').createTHead().id = 'lib-thead'; |
var header = document.getElementById('library').createTHead().id = 'lib-thead'; |
||
jQuery('#lib-header').detach().appendTo('#lib-thead'); |
jQuery('#lib-header').detach().appendTo('#lib-thead'); |
||
document.getElementById('footer-places-disclaimer').style.display = 'none'; |
|||
// Activate DataTable |
// Activate DataTable |
Revision as of 20:51, 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') {
$('#library').dataTable( {
"columnDefs": [
{ "orderData": 4, "targets": 2 }
]
} );
clearInterval(waitForDT);
}
}, 10);
});