2

I want to replace default component Magento_Ui/js/grid/columns/actions with my own component that extends default one.

This is my ./view/adminhtml/requirejs-config.js:

var config = {
    map: {
        '*': {
            'Magento_Ui/js/grid/columns/actions': 'Vendor_Module/js/grid/columns/actions'
        }
    }
};

This is my ./view/adminhtml/web/js/grid/columns/actions.js:

define([
    "jquery",
    "Magento_Ui/js/grid/columns/actions"
], function ($, Component) {
    "use strict"

    debugger
    return Component
})

My custom module is loaded but original (default) "Magento_Ui/js/grid/columns/actions" is undefined (cause I have replaced it in requirejs-config.js I suppose).

How can I extend original component in this case?

2

In your requirejs-config.js

var config = {
    map: {
        '*': {
            'Magento_Ui/js/grid/columns/actions': 'Vendor_Module/js/grid/columns/actions',
            uiGridColumnsActions: 'Magento_Ui/js/grid/columns/actions'
        }
    }
};

and in your file reference not the original path but the mapping name:

define([
    "jquery",
    "uiGridColumnsActions"
], function ($, Component) {
    "use strict";

    return Component;
});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.