From 17f4c5014a1640248f123fdf04adbaf9cfee0d2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Grabowski?= <michal.grabowski@ibexa.co> Date: Mon, 6 Nov 2023 16:11:46 +0100 Subject: [PATCH] IBX-6993: [Fieldtype Matrix] After adding field, "select all checkbox" in table does not work --- .../Resources/public/js/scripts/admin.table.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/bundle/Resources/public/js/scripts/admin.table.js b/src/bundle/Resources/public/js/scripts/admin.table.js index 5f3e91a8d6..e60ac8ee09 100644 --- a/src/bundle/Resources/public/js/scripts/admin.table.js +++ b/src/bundle/Resources/public/js/scripts/admin.table.js @@ -115,7 +115,7 @@ }); }; - ibexaTables.forEach((table) => { + const initTableCheckboxesListeners = (table) => { const tableHasBulkCheckbox = !!table.querySelector( '.ibexa-table__header-cell-checkbox:not(.ibexa-table__header-cell-checkbox--custom-init)', ); @@ -134,6 +134,16 @@ }, false, ); - }); + }; + + ibexaTables.forEach(initTableCheckboxesListeners); initStickyTables(); + + doc.body.addEventListener( + 'ibexa-init-main-table-checkboxes-listeners', + (event) => { + initTableCheckboxesListeners(event.detail.table); + }, + false, + ); })(window, window.document);