Jorge Solá 5/12/2026 7:35:22 AM To show a counter with the number of selected records, you can append the following script to your dbscript-v3.js file (Claude helped me prepare it). I have not tested it with the old UI:
// --- Selected records counter (class‑independent version) --- TD.ready(() => {
let counterBox = null;
function ensureCounter() { if (counterBox) return counterBox;
counterBox = document.createElement("div"); counterBox.id = "td-selected-counter"; counterBox.style.position = "fixed"; counterBox.style.bottom = "20px"; counterBox.style.right = "20px"; counterBox.style.padding = "6px 14px"; counterBox.style.borderRadius = "6px"; counterBox.style.backgroundColor = "#ffeeba"; counterBox.style.border = "1px solid #f0ad4e"; counterBox.style.fontWeight = "600"; counterBox.style.fontSize = "14px"; counterBox.style.boxShadow = "0 2px 6px rgba(0,0,0,0.2)"; counterBox.style.display = "none"; counterBox.style.zIndex = "9999";
document.body.appendChild(counterBox); return counterBox; }
function updateCounter() { const rowCheckboxes = document.querySelectorAll("tbody input[type='checkbox']");
const selected = Array.from(rowCheckboxes).filter(cb => cb.checked).length;
const box = ensureCounter();
if (selected > 0) { box.textContent = `${selected} selected record${selected > 1 ? "s" : ""}`; box.style.display = "block"; } else { box.style.display = "none"; } }
// Event delegation — works regardless of render timing document.addEventListener("change", function (e) { if (e.target.matches("tbody input[type='checkbox']")) { updateCounter(); } });
});
|