mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 11:08:45 +02:00
N°6124 - Performance: Draw datatable only once when elements remove in linksets
This commit is contained in:
@@ -61,7 +61,7 @@ function LinksWidget(id, sClass, sAttCode, iInputId, sSuffix, bDuplicates, oWizH
|
|||||||
this.RemoveSelected = function () {
|
this.RemoveSelected = function () {
|
||||||
let my_id = '#'+me.id;
|
let my_id = '#'+me.id;
|
||||||
$('#linkedset_'+me.id+' .selection:checked').closest('tr').each(function () {
|
$('#linkedset_'+me.id+' .selection:checked').closest('tr').each(function () {
|
||||||
$('#datatable_'+me.id).DataTable().row($(this)).remove().draw();
|
$('#datatable_'+me.id).DataTable().row($(this)).remove();
|
||||||
var oCheckbox = $(this).find('.selection');
|
var oCheckbox = $(this).find('.selection');
|
||||||
let iLink = $(oCheckbox).attr('data-link-id');
|
let iLink = $(oCheckbox).attr('data-link-id');
|
||||||
if (iLink > 0) {
|
if (iLink > 0) {
|
||||||
@@ -80,6 +80,9 @@ function LinksWidget(id, sClass, sAttCode, iInputId, sSuffix, bDuplicates, oWizH
|
|||||||
me.aAdded[iUniqueId] = null;
|
me.aAdded[iUniqueId] = null;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// 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
|
// Disable the button since all the selected items have been removed
|
||||||
$(my_id+'_btnRemove').prop('disabled', true);
|
$(my_id+'_btnRemove').prop('disabled', true);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user