Fix per totali ristretti alla selezione

This commit is contained in:
valentina 2024-08-06 11:37:45 +02:00
parent 85b29b489e
commit a93947e60a
1 changed files with 2 additions and 24 deletions

View File

@ -538,11 +538,7 @@ function getTable(selector) {
getSelectedRowsFooter: function () { getSelectedRowsFooter: function () {
let ids = this.getSelectedRows(); let ids = this.getSelectedRows();
let summable_results = []; return $.ajax({
let avg_results = [];
let results = [];
summable_results = $.ajax({
url: globals.rootdir + "/ajax.php", url: globals.rootdir + "/ajax.php",
type: "POST", type: "POST",
dataType: "json", dataType: "json",
@ -553,25 +549,10 @@ function getTable(selector) {
ids: ids, ids: ids,
} }
}); });
avg_results = $.ajax({
url: globals.rootdir + "/ajax.php",
type: "POST",
dataType: "json",
data: {
id_module: this.id_module,
id_plugin: this.id_plugin,
op: "avg-results",
ids: ids,
}
});
results = $.when(summable_results, avg_results);
return results;
}, },
/** /**
* Aggiornamento dei campi summable e avg * Aggiornamento dei campi summable
*/ */
updateFooterForSelectedRows: function () { updateFooterForSelectedRows: function () {
let datatable = this.datatable; let datatable = this.datatable;
@ -583,9 +564,6 @@ function getTable(selector) {
$(sel).css("text-align", "right") $(sel).css("text-align", "right")
.attr("id", "summable") .attr("id", "summable")
.html(value); .html(value);
$(sel).css("text-align", "right")
.attr("id", "avg")
.html(value);
} }
}); });
}, },