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
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityI'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
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) {
element.visible(false);
});
}
}) });