summenspalte

This commit is contained in:
lelo 2025-06-18 13:57:13 +02:00
parent f3aa4d781b
commit c631e74f5d

View File

@ -176,8 +176,21 @@
columns: cols,
};
// add sum_amount to the footer using column calculations
// If you want to sum the "amount" column, add a bottomCalc to the column definition
cols.forEach(col => {
if (col.field === 'amount') {
col.bottomCalc = 'sum';
col.bottomCalcFormatter = cell => cell.getValue().toFixed(2);
}
});
// Recreate table with updated columns
if (table) table.destroy();
table = new Tabulator('#table', opts);
table = new Tabulator('#table', {
...opts,
columns: cols,
});
} catch (err) {
console.error(err); alert('Failed to load table data');
} finally { hideLoading(); }