Search code examples
orocrmorocommerce

Datagrid navigate link open in new tab


Is it possible to configure datagrid navigate link to open in a new browser tab?

actions:
    view:
        type:          navigate
        label:         oro.grid.action.view
        link:          view_link
        icon:          eye
        acl_resource:  oro_user_user_view
        rowAction:     true

Solution

  • NavigationAction supports only inner navigation. https://github.com/oroinc/platform/blob/master/src/Oro/Bundle/DataGridBundle/Resources/public/js/datagrid/action/navigate-action.js#L60-L91

    But you can create own CustomNavigationAction and implement functionality that you need. Just remember, to get properly mapped from type type: custom-navigation , the module needs an alias with following structure 'oro/datagrid/action/{{type}}-action':

    aliases:
        oro/datagrid/action/custom-navigation$: acme/js/datagrid/action/custom-navigation-action
    
    dynamic-imports:
        orodatagrid:
            - oro/datagrid/action/custom-navigation
    

    see mapper https://github.com/oroinc/platform/blob/master/src/Oro/Bundle/DataGridBundle/Resources/public/js/map-action-module-name.js#L4