N°5074 - Linkset datatable actions row improvements

Linkset updates, feedbacks 09/12:

- Distinguish action label and tool tip message
- Change default action button label Ok => Confirm
- Use action label in place of default confirm button label
- Attach do not show again preference key to table instance
- Obsolescence flag for link selection (select all)  issue correction
This commit is contained in:
bdalsass
2022-12-20 10:10:25 +01:00
committed by GitHub
parent 64146b6e1b
commit eda11e97e3
16 changed files with 109 additions and 27 deletions

View File

@@ -10,21 +10,23 @@
// variables accessible from action row js
let oDatatable = $('#{{ oUIBlock.GetId() }}').DataTable();
let oTrElement = $(this).closest('tr');
let sLabel = $(this).data('label');
let iActionId = $(this).data('action-id');
let aRowData = oDatatable.row(oTrElement).data();
{% if aAction.confirmation is defined %}
// Prepare confirmation message
let sMessage = '{{ 'UI:Datatables:RowActions:ConfirmationMessage'|dict_s }}';
let sMessage = `{{ 'UI:Datatables:RowActions:ConfirmationMessage'|dict_s|raw }}`;
{% if aAction.confirmation.message is defined %}
sMessage = '{{ aAction.confirmation.message|dict_s|raw }}';
sMessage = `{{ aAction.confirmation.message|dict_s|raw }}`;
{% endif %}
// Handle action row with confirmation modal
CombodoModal.OpenConfirmationModal({
title: '{{ 'UI:Datatables:RowActions:ConfirmationDialog'|dict_s }}',
content: sMessage.replaceAll('{item}', aRowData['{{ aAction.confirmation.message_row_data }}']),
confirm_button_label: sLabel,
callback_on_confirm: ActionRowFunction{{ oUIBlock.GetId() }}{{ loop.index0 }},
{% if aAction.confirmation.do_not_show_again_pref_key is defined %}
do_not_show_again_pref_key: '{{ aAction.confirmation.do_not_show_again_pref_key }}',