mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Issue/5074 - Routage, Block UI relations, Links row actions (#369)
* 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
This commit is contained in:
@@ -80,28 +80,3 @@ function getMultipleSelectionParams(listId)
|
||||
return oRes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return column JSON declaration for row actions.
|
||||
* Could be part of column or columnDefs declaration of datatable.js.
|
||||
*
|
||||
* @param sTableId
|
||||
* @param iColumnTargetIndex
|
||||
* @returns {*}
|
||||
* @since 3.1.0
|
||||
*/
|
||||
function getRowActionsColumnDefinition(sTableId, iColumnTargetIndex = -1)
|
||||
{
|
||||
let aColumn = {
|
||||
type: "html",
|
||||
orderable: false,
|
||||
render: function ( data, type, row, meta ) {
|
||||
return $(`#${sTableId}_actions_buttons_template`).html();
|
||||
}
|
||||
};
|
||||
|
||||
if (iColumnTargetIndex !== -1) {
|
||||
aColumn['targets'] = iColumnTargetIndex;
|
||||
}
|
||||
|
||||
return aColumn;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user