diff --git a/app/code/Magento/Ui/view/base/web/js/grid/columns/actions.js b/app/code/Magento/Ui/view/base/web/js/grid/columns/actions.js index 6174700c27a8b..a4c56958911a8 100644 --- a/app/code/Magento/Ui/view/base/web/js/grid/columns/actions.js +++ b/app/code/Magento/Ui/view/base/web/js/grid/columns/actions.js @@ -176,6 +176,20 @@ define([ } }, + /** + * Returns target of action if it's been set. + * + * @param {Object} action - Action object. + * @returns {String} + */ + getTarget: function (action) { + if (action.target) { + return action.target; + } + + return '_self'; + }, + /** * Checks if specified action requires a handler function. * diff --git a/app/code/Magento/Ui/view/base/web/templates/grid/cells/actions.html b/app/code/Magento/Ui/view/base/web/templates/grid/cells/actions.html index ccaec7b3a2192..3465e4774e9c4 100644 --- a/app/code/Magento/Ui/view/base/web/templates/grid/cells/actions.html +++ b/app/code/Magento/Ui/view/base/web/templates/grid/cells/actions.html @@ -10,13 +10,13 @@ repeat="foreach: $col.getVisibleActions($row()._rowIndex), item: '$action'" click="$col.getActionHandler($action())" text="$action().label" - attr="href: $action().href"/> + attr="target: $col.getTarget($action()), href: $action().href"/>