N°5073 - Issue, row actions listeners lost on refresh

This commit is contained in:
Benjamin Dalsass
2022-12-07 15:31:19 +01:00
parent e4d8489292
commit 9defedb862
2 changed files with 2 additions and 2 deletions

View File

@@ -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);
}

View File

@@ -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();