mirror of
https://github.com/Combodo/iTop.git
synced 2026-03-04 08:34:11 +01:00
* datatable row actions
Below is a sample of extra param to enable feature:
$aExtraParams['row_actions'] = [
[
'tooltip' => 'remove an element',
'icon_css_class' => 'fa-minus',
'js_row_action' => 'console.log("You clicked the remove button");',
'confirmation' => [
'message' => 'UI:ConfirmationMessage',
'message_row_data' => "name",
'remember_choice_pref_key' => 'remove_do_not_show_again',
],
],
[
'tooltip' => 'open in new tab',
'icon_css_class' => 'fa-external-link-square-alt',
'on_action_js' => 'window.open("http://localhost/itop-branchs/dev/pages/UI.php?operation=details&class=UserRequest&id=" + aData.id + "&c[menu]=UserRequest%3AOpenRequests");',
],
[
'tooltip' => 'other actions',
'icon_css_class' => 'fa-ellipsis-v',
'on_action_js' => 'console.log(event);',
],
];
* Contrôleur pour la suppression et le détachement de liens
* Block UI pour l'édition des relations
* Block UI pour la visualisation des relations
* Boutons d'actions pour la suppression et le détachement de liens
* Gestion dialogue de confirmation pour les row actions
34 lines
1.8 KiB
Twig
34 lines
1.8 KiB
Twig
{% for oSubBlock in oUIBlock.GetSubBlocks() %}{{ render_block(oSubBlock, {aPage: aPage}) }}{% endfor %}
|
|
|
|
{% if oUIBlock.GetOptions("select_mode") is not empty %}
|
|
<input type="hidden" name="selectionMode" value="{{ oUIBlock.GetOption("selectionMode") }}">
|
|
<input type="hidden" name="selectionCount" value="0">
|
|
<div data-target="ibo-datatable--selection"></div>
|
|
{% if oUIBlock.GetAjaxData("extra_params") is not empty %}
|
|
<input type="hidden" name="extra_params" value="{{ oUIBlock.GetAjaxData("extra_params")|raw|json_encode }}">
|
|
{% endif %}
|
|
{% if oUIBlock.GetAjaxData("filter") is not empty %}
|
|
<input type="hidden" name="filter" value="{{ oUIBlock.GetAjaxData("filter")|raw }}">
|
|
{% endif %}
|
|
{% endif %}
|
|
|
|
<table id="{{ oUIBlock.GetId() }}" width="100%" class="{{ oUIBlock.GetBlocksInheritanceCSSClassesAsString() }} {{ oUIBlock.GetAdditionalCSSClassesAsString() }} {% if oUIBlock.IsHidden() %}ibo-is-hidden{% endif %}" data-role="ibo-datatable" data-status="loading">
|
|
<thead>
|
|
{% if oUIBlock.GetOption("select_mode") is not empty %}
|
|
<th></th>
|
|
{% endif %}
|
|
{% for aColumn in oUIBlock.GetDisplayColumns() %}
|
|
<th class="ibo-datatable-header" {% if aColumn["description"] is not empty %}title="{{ aColumn["description"] }}"{% endif %}>{{ aColumn["attribute_label"] }} </th>
|
|
{% endfor %}
|
|
{% if oUIBlock.HasRowActions() %}
|
|
<th class="ibo-datatable-header" title="{{ 'UI:Datatables:Column:RowActions:Description'|dict_s }}">{{ 'UI:Datatables:Column:RowActions:Label'|dict_s }} </th>
|
|
{% endif %}
|
|
</thead>
|
|
</table>
|
|
|
|
{% if oUIBlock.HasRowActions() %}
|
|
{{ render_block(oUIBlock.GetRowActionsTemplate()) }}
|
|
{% if not oUIBlock.GetRowActionsConfirmDialogInitializedFlag() %}
|
|
{{ render_block(oUIBlock.GetRowActionsConfirmDialog()) }}
|
|
{% endif %}
|
|
{% endif %} |