diff --git a/sources/Application/UI/Base/Component/DataTable/DataTableUIBlockFactory.php b/sources/Application/UI/Base/Component/DataTable/DataTableUIBlockFactory.php index 9add4be7b..2093263a1 100644 --- a/sources/Application/UI/Base/Component/DataTable/DataTableUIBlockFactory.php +++ b/sources/Application/UI/Base/Component/DataTable/DataTableUIBlockFactory.php @@ -214,7 +214,7 @@ class DataTableUIBlockFactory extends AbstractUIBlockFactory array_key_exists('tooltip', $aAction) ? Dict::S($aAction['tooltip']) : '', array_key_exists('name', $aAction) ? $aAction['name'] : 'undefined' ); - $oButton->SetDataAttributes(['action-id' => $iKey, 'tooltip-append-to' => 'body']); + $oButton->SetDataAttributes(['action-id' => $iKey, 'table-id' => $oTable->GetId()]); $oToolbar->AddSubBlock($oButton); } diff --git a/templates/base/components/datatable/row-actions/handler.js.twig b/templates/base/components/datatable/row-actions/handler.js.twig index 68f69b911..c64762edf 100644 --- a/templates/base/components/datatable/row-actions/handler.js.twig +++ b/templates/base/components/datatable/row-actions/handler.js.twig @@ -5,7 +5,7 @@ {% for aAction in oUIBlock.GetRowActions() %} // register action buttons click - $('#{{ oUIBlock.GetId() }} tbody').on('click', 'button[data-action-id="{{ loop.index0 }}"]', function() { + $('body').on('click', 'button[data-table-id="{{ oUIBlock.GetId() }}"][data-action-id="{{ loop.index0 }}"]', function() { // variables accessible from action row js let oDatatable = $('#{{ oUIBlock.GetId() }}').DataTable();