1

I have a select in a Magento 2 template initialised using the uiClass with the code below:

define([
    'Magento_Ui/js/form/element/select',
    'jquery',
    'domReady',
], function (Select, $) {
    'use strict';

    return Select.extend({
        initialize: function () {
            this._super();

            $("#" + this.uid).closest('div').css('padding', '10px').css('border', '1px solid red')
        }
    })
});

Whilst the select appears as expected, I struggle to change its rendering with jquery.

Has anybody resolved this issue?

1

You can add a custom template to your component using the elementTmpl parameter.

More information can be found here: https://devdocs.magento.com/guides/v2.3/ui_comp_guide/components/ui-select.html

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.