diff --git a/js/links/links_widget.js b/js/links/links_widget.js index 25f43c438..d14be2f78 100644 --- a/js/links/links_widget.js +++ b/js/links/links_widget.js @@ -69,6 +69,9 @@ function LinksWidget(id, sClass, sAttCode, iInputId, sSuffix, bDuplicates, oWizH $('#linkedset_'+me.id+' .selection:checked').closest('tr').each(function () { me.Remove($(this)); }); + // N°6124 Only draw table once for performance reasons + $('#datatable_'+me.id).DataTable().draw(); + // Disable the button since all the selected items have been removed $(my_id+'_btnRemove').prop('disabled', true); @@ -82,7 +85,7 @@ function LinksWidget(id, sClass, sAttCode, iInputId, sSuffix, bDuplicates, oWizH }; this.Remove = function(oRowElement){ - $('#datatable_'+me.id).DataTable().row($(oRowElement)).remove().draw(); + $('#datatable_'+me.id).DataTable().row($(oRowElement)).remove(); var oCheckbox = $(oRowElement).find('.selection'); let iLink = $(oCheckbox).attr('data-link-id'); if (iLink > 0) { @@ -265,9 +268,10 @@ function LinksWidget(id, sClass, sAttCode, iInputId, sSuffix, bDuplicates, oWizH function (data) { if (data != '') { $.each(data.data, function (idx, row) { - $('#datatable_'+me.id).DataTable().row.add(row).draw(); + $('#datatable_'+me.id).DataTable().row.add(row); }); - + // N°6124 Only draw table once for performance reasons + $('#datatable_'+me.id).DataTable().draw(); $.each(data.scripts, function (idx, script) { $.globalEval(script); @@ -277,7 +281,6 @@ function LinksWidget(id, sClass, sAttCode, iInputId, sSuffix, bDuplicates, oWizH $(this).trigger('validate', ''); }); // Validate newly added form fields... $('#datatable_'+me.id).DataTable().columns.adjust().draw(); - //$('#datatable_team_list').DataTable().columns.adjust().draw(); $('#busy_'+me.iInputId).html(''); } },