I want to disable the "Entries per page" dropdown and the search bar.
I saw the below codes (BLOCK 1) in the documentation, but I don't think I understand how to implement those in my current script (BLOCK 2). I tried what I could, it didn't work.
/* BLOCK 1 */
$(document).ready(function () {
$('#dtBasicExample').DataTable({
"ordering": false // false to disable sorting (or any other option)
});
$('.dataTables_length').addClass('bs-select');
});
/* BLOCK 2 */
window.addEventListener('DOMContentLoaded', event => {
// Simple-DataTables
// https://github.com/fiduswriter/Simple-DataTables/wiki
const datatablesSimple = document.getElementById('datatablesSimple');
if (datatablesSimple) {
new simpleDatatables.DataTable(datatablesSimple, {
perPage: 1,
});
}
});