TeamDesk Knowledge Base & Support

   Home      FAQ      Forum      Idea Exchange      Ask a Question      My Stuff      Help   
  
Display # of selected records in grouped table views
In a grouped table view, the number of records in each group is shown on the group header line, for instance "61 records".

When there are multi-record buttons present or the mass delete option is checked, a box shows by each record to be able to select it.

Can we have the number of selected records shown on the group header line? For instance, "61 records - 45 selected", or "61 records - 0 selected " (by default). It would be nice to know how many records will be affected by the action before we run it.
ID
2146
Category
User Experience
Author

Jorge Solá
Date Created
4/20/2026 9:54:58 AM
Date Updated
5/15/2026 11:17:17 AM
Status
New Idea
Score
30
Promoted By
Luison LassalaPatricio BustosJorge Solá
Comments
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();
}
});

});
Jorge Solá 5/13/2026 5:15:20 PM
This version works better:

// --- Selected records counter (count only real record rows) ---
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 getRecordCheckboxes() {
// grouped views: count only actual record rows
const groupedRowCheckboxes = Array.from(
document.querySelectorAll("tr.v3-tableview__group-row input[type='checkbox']")
);

if (groupedRowCheckboxes.length) {
return groupedRowCheckboxes;
}

// non-grouped fallback: exclude obvious non-record rows
return Array.from(
document.querySelectorAll("tbody tr input[type='checkbox']")
).filter(cb => {
const row = cb.closest("tr");
return row &&
!row.classList.contains("v3-tableview__grouphead") &&
!row.classList.contains("v3-tableview__groupfoot") &&
!row.closest("thead");
});
}

function updateCounter() {
const selected = getRecordCheckboxes().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";
}
}

document.addEventListener("change", function (e) {
if (e.target.matches("input[type='checkbox']")) {
updateCounter();
}
});

updateCounter();
});
Luison Lassala 5/15/2026 10:47:13 AM
Looks good Jorge - well done! I had this request from several users.
Where is the selection counter displayed: on the Grouping header as suggested in the question??
Could you post a screenshot here??
Jorge Solá 5/15/2026 11:13:01 AM
It's shown on a floating box in the lower right corner of the screen.

(I don't see an option to add a screenshot here.)
Luison Lassala 5/15/2026 11:17:17 AM
Thanks Jorge. Maybe you could send me a screenshot by email luison@bedrocksuccess.ie ?
(¡un saludo!)
Feedback
 
Back to Search Results