N°3123 - Fix table counts on search results

This commit is contained in:
Eric
2020-12-14 18:31:32 +01:00
parent c106caf924
commit 9df80b9f79
7 changed files with 94 additions and 89 deletions

View File

@@ -34,15 +34,25 @@ function checkAllDataTable(tableId, value, listId) {
function updateDataTableSelection(listId) {
let selectionContainer = $('#'+listId+' [data-target="ibo-datatable--selection"]');
let selectionCount = $('#'+listId+' [name="selectionCount"]');
let selectionMode = $('#'+listId+' [name=selectionMode]');
selectionContainer.html('');
let currentSelection = window['oSelectedItems'+listId];
for(let i in currentSelection) {
let value = currentSelection[i];
selectionContainer.append('<input type="hidden" name="storedSelection[]" value="' + value + '">');
}
selectionCount.val(currentSelection.length);
if (selectionMode === 'negative') {
let total = window['oTable'+listId].page.info()["recordsTotal"];
selectionCount.val(total - currentSelection.length);
} else {
selectionCount.val(currentSelection.length);
}
selectionCount.trigger('change');
}
function getMultipleSelectionParams(listId)
{
var oRes = {};