I'm having a enabled field in admin/customer/index/new but when forward to admin/customer/index/edit/id/{id}, I'd like to have it disabled. It'd be great if done in PHP.

I notice that both using base/ui_component/customer_form.xml

  • customer_index_new is your custom created layout ? – Msquare Apr 23 at 5:40
  • no mate, I haven't created anything. – Long Nguyen Apr 23 at 7:48

I'm finally able to disable it using js, so I leave the solution here.

require(['jquery', 'uiRegistry'], function ($, uiRegistry) {
        $(window).on('load', function () {
            var url       = window.location.href;
            var arguments = url.split('/');
            if (jQuery.inArray("id", arguments) !== -1) {
                uiRegistry.get('customer_form.areas.customer.customer.password', function (element) {
        }) });
| improve this answer | |

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.