Created
May 23, 2025 14:33
-
-
Save kampar/cfa66d5e8d2c879b4a441bf4dd27c5c2 to your computer and use it in GitHub Desktop.
remove limit 10 item per halaman
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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