Temp: add console.debug to updateTotals for diagnosis
This commit is contained in:
@@ -28,10 +28,13 @@
|
||||
// Each key must exactly match a property returned by the server's PatchItem action.
|
||||
function updateTotals(cfg, data) {
|
||||
const t = cfg.totals || {};
|
||||
console.debug('[inline-edit] updateTotals data:', data, 'totals cfg:', t);
|
||||
Object.entries(t).forEach(([key, selector]) => {
|
||||
const val = data[key];
|
||||
const els = document.querySelectorAll(selector);
|
||||
console.debug(`[inline-edit] ${key} → "${selector}": val=${val}, elements=${els.length}`);
|
||||
if (selector && val !== undefined && val !== null) {
|
||||
document.querySelectorAll(selector).forEach(el => { el.textContent = fmt(val); });
|
||||
els.forEach(el => { el.textContent = fmt(val); });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user