Menu Close
    Start a Project Request quote Reading list Switch to dark mode

    How to extend jQuery widget in magento 2

    How to extend jQuery widget in magento 2: In this blog we will see how we can extend magento jQuery widget. We can extend jQuery widgets by using mixins.

    In java script mixin is a class whose methods are added to, or mixed in, with another class.

    In order to extend jQuery widget first we need to declare a mixin in requirejs-config.js file like below.

    Now for example parent widget(Vendor_ParentModule/js/super) is like below

    Then in child widget(Vendor_ChildModule/js/child) we can override it’s method like below

    In this way we can override all the methods of jQuery widget in Magento 2. If you have any query then comment below.

    . . .


    Add Your Comment

    Be the first to comment.

    Back to Top
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again