is anybody know how to sum in tableviewev lookup fields.
picture in attach
lookup field sum
Re: lookup field sum
If these are lookup fields, as you say, there is only primary keys (IDs) inside the database table. I don't think building a sum would give any useful information.
Just in case those fields are autofill-lookup fields, having numeric display values, there is still only primary keys in the database for them.
Maybe I'm wrong, but I don't think there is a built in functionality for loading related values from the master table and summing them up.
Should work with javascript.
Just in case those fields are autofill-lookup fields, having numeric display values, there is still only primary keys in the database for them.
Maybe I'm wrong, but I don't think there is a built in functionality for loading related values from the master table and summing them up.
Should work with javascript.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools
Re: lookup field sum
Jan can you give me some example for this?
Re: lookup field sum
(Additional) Custom Row in
You can identify the column by index (
For pupulating the cell-contents, for example use
This is just an example, showing the first steps. Completing it including AJAX, serverside script, formatting, error-handling etc. would take too much time now.
<tfoot>
. Code: Select all
// file: hooks/TABLENAME-tv.js
jQuery(document).ready(function () {
const table = jQuery(`table.table[data-tablename='${AppGini.currentTableName()}']:eq(0)`);
const tfoot = table.children("tfoot:eq(0)");
const tr = jQuery("<tr/>").addClass("info").prependTo(tfoot);
table.find("thead:eq(0) > tr:eq(0) > th").each(function (i, e) {
const th = jQuery("<th/>")
.appendTo(tr)
.addClass("text-nowrap")
.append(i > 0 ? `cell #${i}` : '')
.append("<br/>")
.append(jQuery("<code/>").append(i > 0 ? `${jQuery(e)[0].classList[0]}` : ''));
});
});
You can identify the column by index (
i
-variable) or by evaluating class-name of cell, which should be in format TABLENAME-COLUMN.For pupulating the cell-contents, for example use
jQuery.getJSON(...)
and fetch sums from your server using your own API or 3rd party API.This is just an example, showing the first steps. Completing it including AJAX, serverside script, formatting, error-handling etc. would take too much time now.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 24.10 Revision 1579 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 24.10 Revision 1579 + all AppGini Helper tools