MediaWiki:Datatables custom.js

From Comprehensible Input Wiki
Revision as of 02:09, 5 February 2023 by Dimpizzy (talk | contribs)

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
$(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
$('#library').dataTable( {
  "columnDefs": [
    { "orderData": 4, "targets": 2 }
  ]
} );

});