Magento

Magento 2 : External link in admin order grid not linking when click

Pinterest LinkedIn Tumblr

Vendor/MyModule/view/adminhtml/ui_component/my_grid_listing.xml file:

<column name="link">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="label" xsi:type="string" translate="true">Link</item>
            <item name="component" xsi:type="string">Vendor_MyModule/js/grid/cells/link</item>
            <item name="sortOrder" xsi:type="number">50</item>
            <item name="sortable" xsi:type="boolean">false</item>
            <item name="disableAction" xsi:type="boolean">true</item>
        </item>
    </argument>
</column>

and disabled function getFieldHandler() in:

Vendor/MyModule/view/adminhtml/web/js/grid/cells/link.js

define([
        'Magento_Ui/js/grid/columns/column'
    ],
    function (Column) {
        'use strict';

        return Column.extend({
            defaults: {
                bodyTmpl: 'Vendor_MyModule/grid/cells/link',

            },

            getFieldHandler: function (record) {
                return false;
            }
        });
    }
);

Template:

Vendor/MyModule/view/adminhtml/web/template/grid/cells/link.html

Write A Comment