Skip to content

Instantly share code, notes, and snippets.

@kampar
Created May 23, 2025 14:33
Show Gist options
  • Save kampar/cfa66d5e8d2c879b4a441bf4dd27c5c2 to your computer and use it in GitHub Desktop.
Save kampar/cfa66d5e8d2c879b4a441bf4dd27c5c2 to your computer and use it in GitHub Desktop.
remove limit 10 item per halaman
// ==UserScript==
// @name Show All Downloads simple-datatables
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Overrides the perPage setting for simple-datatables to show all entries.
// @author Your Name
// @match https://digipanel.id/*
// @grant none
// @run-at document-end
// ==/UserScript==
(function() {
'use strict';
// Wait for the simple-datatables library to be available and initialized
// This is crucial because the table is initialized asynchronously after a fetch.
const originalDataTable = simpleDatatables.DataTable;
simpleDatatables.DataTable = function(element, options) {
// Check if this is the specific table we want to modify (e.g., #downloadTable)
if (element === '#downloadTable') {
options.perPage = 10000; // Or any sufficiently large number
console.log("Tampermonkey: Modified perPage for #downloadTable to show all.");
}
// Call the original simpleDatatables.DataTable constructor
return new originalDataTable(element, options);
};
// You might also need to handle cases where the table is already initialized
// if the script runs after the table is created.
// The `run-at document-end` and overriding the constructor should generally work.
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment