Fix chiamate ajax infinite con l'impostazione di calcolo totali ristretti a selezione

This commit is contained in:
loviuz 2022-10-27 19:23:16 +02:00
parent 512e04ef45
commit 03394391bc
1 changed files with 17 additions and 11 deletions

View File

@ -16,6 +16,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
var first_load_complete = false;
function start_local_datatables() { function start_local_datatables() {
$('.datatables').each(function () { $('.datatables').each(function () {
if (!$.fn.DataTable.isDataTable($(this))) { if (!$.fn.DataTable.isDataTable($(this))) {
@ -348,6 +350,7 @@ function initComplete(settings) {
setTimeout(function () { setTimeout(function () {
$('.select-checkbox').each(function(){ $('.select-checkbox').each(function(){
if (first_load_complete) {
var row = $(this).parent(); var row = $(this).parent();
var row_id = row.attr("id"); var row_id = row.attr("id");
@ -363,6 +366,7 @@ function initComplete(settings) {
wrapper.removeSelectedRows(row_id); wrapper.removeSelectedRows(row_id);
} }
} }
}
}); });
}, 1000); }, 1000);
} }
@ -402,6 +406,8 @@ function drawCallback(settings) {
}).select(); }).select();
} }
}); });
first_load = true;
} }
function footerCallback(row, data, start, end, display) { function footerCallback(row, data, start, end, display) {