Cannot read property 'get' of undefined Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar ManaraUncaught TypeError: Cannot read property 'get' of undefinedjQuery UI breaks when clicking on draggable element: “Cannot read property 'defaultView' of undefined”Cannot Read Property “quoteData” of undefined magento 2.2.2Cannot get current order in Magento 2.2How to use third party jquery libraries in magento along with requirejs?Magento 2: Cannot read property 'dialog' of undefined, 'timepicker' of undefined,'RFC_2822' of undefinedMagento2 checkout gives “Cannot read property 'items' of undefined - totals.js:22”Created node doesn't have attachEvent propertyHow to hide particular admin form field(UI Component) based on the value of select field?Magento 2: Uncaught TypeError: Cannot read property 'items' of null for restricted permission user
Can I criticise the more senior developers around me for not writing clean code?
How to open locks without disable device?
Is Diceware more secure than a long passphrase?
How would this chord from "Rocket Man" be analyzed?
How to keep bees out of canned beverages?
Are all CP/M-80 implementations binary compatible?
Multiple options vs single option UI
Are there moral objections to a life motivated purely by money? How to sway a person from this lifestyle?
Did the Roman Empire have penal colonies?
Would reducing the reference voltage of an ADC have any effect on accuracy?
Putting Ant-Man on house arrest
What is this word supposed to be?
Justification for leaving new position after a short time
How to translate "red flag" into Spanish?
Trumpet valves, lengths, and pitch
Second order approximation of the loss function (Deep learning book, 7.33)
Married in secret, can marital status in passport be changed at a later date?
What do you call the part of a novel that is not dialog?
What was Apollo 13's "Little Jolt" after MECO?
Retract an already submitted recommendation letter (written for an undergrad student)
Does Feeblemind produce an ongoing magical effect that can be dispelled?
What ability score does a Hexblade's Pact Weapon use for attack and damage when wielded by another character?
Does Mathematica have an implementation of the Poisson binomial distribution?
The art of proof summarizing. Are there known rules, or is it a purely common sense matter?
Cannot read property 'get' of undefined
Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar ManaraUncaught TypeError: Cannot read property 'get' of undefinedjQuery UI breaks when clicking on draggable element: “Cannot read property 'defaultView' of undefined”Cannot Read Property “quoteData” of undefined magento 2.2.2Cannot get current order in Magento 2.2How to use third party jquery libraries in magento along with requirejs?Magento 2: Cannot read property 'dialog' of undefined, 'timepicker' of undefined,'RFC_2822' of undefinedMagento2 checkout gives “Cannot read property 'items' of undefined - totals.js:22”Created node doesn't have attachEvent propertyHow to hide particular admin form field(UI Component) based on the value of select field?Magento 2: Uncaught TypeError: Cannot read property 'items' of null for restricted permission user
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have created a custom js
for customer add form. But I am getting the error "can not read property 'get' of undefined" in console.
Please help. Thanks in advance.
Vendor/CustomCustomer/view/base/web/customercustom.js
define([
"jquery",
'jquery/ui',
'underscore',
'uiRegistry',
'Magento_Ui/js/form/element/select',
'mage/url'
], function (_, uiRegistry, Select)
'use strict';
return function (Select)
return Select.extend(
initialize: function (value)
this._super();
var customerCompany = uiRegistry.get('index = customer_company');
var defaultCompany = uiRegistry.get('index = extension_attributes.company_attributes.company_id');
var vessels = uiRegistry.get('index = customer_vessels');
var customerUsername = uiRegistry.get('index = customer_username');
var password = uiRegistry.get('index = password');
var cnfpassword = uiRegistry.get('index = confirm_password');
if (this.value() != 1)
customerCompany.show();
defaultCompany.hide();
vessels.show();
customerUsername.show();
password.show();
cnfpassword.show();
else
customerCompany.hide();
defaultCompany.show();
vessels.hide();
customerUsername.hide();
password.hide();
cnfpassword.hide();
return this;
,
onUpdate: function (value)
var customerCompany = uiRegistry.get('index = customer_company');
var defaultCompany = uiRegistry.get('index = extension_attributes.company_attributes.company_id');
var customerUsername = uiRegistry.get('index = customer_username');
var password = uiRegistry.get('index = password');
var cnfpassword = uiRegistry.get('index = confirm_password');
if (value != 1)
customerCompany.show();
defaultCompany.hide();
customerUsername.show();
password.show();
cnfpassword.show();
else
customerCompany.hide();
defaultCompany.show();
customerUsername.hide();
password.hide();
cnfpassword.hide();
return this._super();
,
);
);
magento2.2 requirejs
add a comment |
I have created a custom js
for customer add form. But I am getting the error "can not read property 'get' of undefined" in console.
Please help. Thanks in advance.
Vendor/CustomCustomer/view/base/web/customercustom.js
define([
"jquery",
'jquery/ui',
'underscore',
'uiRegistry',
'Magento_Ui/js/form/element/select',
'mage/url'
], function (_, uiRegistry, Select)
'use strict';
return function (Select)
return Select.extend(
initialize: function (value)
this._super();
var customerCompany = uiRegistry.get('index = customer_company');
var defaultCompany = uiRegistry.get('index = extension_attributes.company_attributes.company_id');
var vessels = uiRegistry.get('index = customer_vessels');
var customerUsername = uiRegistry.get('index = customer_username');
var password = uiRegistry.get('index = password');
var cnfpassword = uiRegistry.get('index = confirm_password');
if (this.value() != 1)
customerCompany.show();
defaultCompany.hide();
vessels.show();
customerUsername.show();
password.show();
cnfpassword.show();
else
customerCompany.hide();
defaultCompany.show();
vessels.hide();
customerUsername.hide();
password.hide();
cnfpassword.hide();
return this;
,
onUpdate: function (value)
var customerCompany = uiRegistry.get('index = customer_company');
var defaultCompany = uiRegistry.get('index = extension_attributes.company_attributes.company_id');
var customerUsername = uiRegistry.get('index = customer_username');
var password = uiRegistry.get('index = password');
var cnfpassword = uiRegistry.get('index = confirm_password');
if (value != 1)
customerCompany.show();
defaultCompany.hide();
customerUsername.show();
password.show();
cnfpassword.show();
else
customerCompany.hide();
defaultCompany.show();
customerUsername.hide();
password.hide();
cnfpassword.hide();
return this._super();
,
);
);
magento2.2 requirejs
add a comment |
I have created a custom js
for customer add form. But I am getting the error "can not read property 'get' of undefined" in console.
Please help. Thanks in advance.
Vendor/CustomCustomer/view/base/web/customercustom.js
define([
"jquery",
'jquery/ui',
'underscore',
'uiRegistry',
'Magento_Ui/js/form/element/select',
'mage/url'
], function (_, uiRegistry, Select)
'use strict';
return function (Select)
return Select.extend(
initialize: function (value)
this._super();
var customerCompany = uiRegistry.get('index = customer_company');
var defaultCompany = uiRegistry.get('index = extension_attributes.company_attributes.company_id');
var vessels = uiRegistry.get('index = customer_vessels');
var customerUsername = uiRegistry.get('index = customer_username');
var password = uiRegistry.get('index = password');
var cnfpassword = uiRegistry.get('index = confirm_password');
if (this.value() != 1)
customerCompany.show();
defaultCompany.hide();
vessels.show();
customerUsername.show();
password.show();
cnfpassword.show();
else
customerCompany.hide();
defaultCompany.show();
vessels.hide();
customerUsername.hide();
password.hide();
cnfpassword.hide();
return this;
,
onUpdate: function (value)
var customerCompany = uiRegistry.get('index = customer_company');
var defaultCompany = uiRegistry.get('index = extension_attributes.company_attributes.company_id');
var customerUsername = uiRegistry.get('index = customer_username');
var password = uiRegistry.get('index = password');
var cnfpassword = uiRegistry.get('index = confirm_password');
if (value != 1)
customerCompany.show();
defaultCompany.hide();
customerUsername.show();
password.show();
cnfpassword.show();
else
customerCompany.hide();
defaultCompany.show();
customerUsername.hide();
password.hide();
cnfpassword.hide();
return this._super();
,
);
);
magento2.2 requirejs
I have created a custom js
for customer add form. But I am getting the error "can not read property 'get' of undefined" in console.
Please help. Thanks in advance.
Vendor/CustomCustomer/view/base/web/customercustom.js
define([
"jquery",
'jquery/ui',
'underscore',
'uiRegistry',
'Magento_Ui/js/form/element/select',
'mage/url'
], function (_, uiRegistry, Select)
'use strict';
return function (Select)
return Select.extend(
initialize: function (value)
this._super();
var customerCompany = uiRegistry.get('index = customer_company');
var defaultCompany = uiRegistry.get('index = extension_attributes.company_attributes.company_id');
var vessels = uiRegistry.get('index = customer_vessels');
var customerUsername = uiRegistry.get('index = customer_username');
var password = uiRegistry.get('index = password');
var cnfpassword = uiRegistry.get('index = confirm_password');
if (this.value() != 1)
customerCompany.show();
defaultCompany.hide();
vessels.show();
customerUsername.show();
password.show();
cnfpassword.show();
else
customerCompany.hide();
defaultCompany.show();
vessels.hide();
customerUsername.hide();
password.hide();
cnfpassword.hide();
return this;
,
onUpdate: function (value)
var customerCompany = uiRegistry.get('index = customer_company');
var defaultCompany = uiRegistry.get('index = extension_attributes.company_attributes.company_id');
var customerUsername = uiRegistry.get('index = customer_username');
var password = uiRegistry.get('index = password');
var cnfpassword = uiRegistry.get('index = confirm_password');
if (value != 1)
customerCompany.show();
defaultCompany.hide();
customerUsername.show();
password.show();
cnfpassword.show();
else
customerCompany.hide();
defaultCompany.show();
customerUsername.hide();
password.hide();
cnfpassword.hide();
return this._super();
,
);
);
magento2.2 requirejs
magento2.2 requirejs
edited 2 days ago
Rv Singh
732418
732418
asked 2 days ago
Meetali GuptaMeetali Gupta
778
778
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Change position of jquery components in define()
as below:
define([
'jquery',
'underscore',
'uiRegistry',
'Magento_Ui/js/form/element/select',
'jquery/ui',
'mage/url'
], function ($, _, uiRegistry, Select)
'use strict';
return function (Select)
return Select.extend(
initialize: function (value)
this._super();
var customerCompany = uiRegistry.get('index = customer_company');
var defaultCompany = uiRegistry.get('index = extension_attributes.company_attributes.company_id');
var vessels = uiRegistry.get('index = customer_vessels');
var customerUsername = uiRegistry.get('index = customer_username');
var password = uiRegistry.get('index = password');
var cnfpassword = uiRegistry.get('index = confirm_password');
if (this.value() != 1)
customerCompany.show();
defaultCompany.hide();
vessels.show();
customerUsername.show();
password.show();
cnfpassword.show();
else
customerCompany.hide();
defaultCompany.show();
vessels.hide();
customerUsername.hide();
password.hide();
cnfpassword.hide();
return this;
,
onUpdate: function (value)
var customerCompany = uiRegistry.get('index = customer_company');
var defaultCompany = uiRegistry.get('index = extension_attributes.company_attributes.company_id');
var customerUsername = uiRegistry.get('index = customer_username');
var password = uiRegistry.get('index = password');
var cnfpassword = uiRegistry.get('index = confirm_password');
if (value != 1)
customerCompany.show();
defaultCompany.hide();
customerUsername.show();
password.show();
cnfpassword.show();
else
customerCompany.hide();
defaultCompany.show();
customerUsername.hide();
password.hide();
cnfpassword.hide();
return this._super();
,
);
);
Thanks for the response. After making the abover mentioned changes now I am getting the error "Cannot read property 'show' of undefined".
– Meetali Gupta
2 days ago
it means selector on which you are using show() method is undefine, means you didnt get selector using uiRegistry
– Satish Dubariya
yesterday
But it works on the second reload.
– Meetali Gupta
yesterday
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f270933%2fcannot-read-property-get-of-undefined%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Change position of jquery components in define()
as below:
define([
'jquery',
'underscore',
'uiRegistry',
'Magento_Ui/js/form/element/select',
'jquery/ui',
'mage/url'
], function ($, _, uiRegistry, Select)
'use strict';
return function (Select)
return Select.extend(
initialize: function (value)
this._super();
var customerCompany = uiRegistry.get('index = customer_company');
var defaultCompany = uiRegistry.get('index = extension_attributes.company_attributes.company_id');
var vessels = uiRegistry.get('index = customer_vessels');
var customerUsername = uiRegistry.get('index = customer_username');
var password = uiRegistry.get('index = password');
var cnfpassword = uiRegistry.get('index = confirm_password');
if (this.value() != 1)
customerCompany.show();
defaultCompany.hide();
vessels.show();
customerUsername.show();
password.show();
cnfpassword.show();
else
customerCompany.hide();
defaultCompany.show();
vessels.hide();
customerUsername.hide();
password.hide();
cnfpassword.hide();
return this;
,
onUpdate: function (value)
var customerCompany = uiRegistry.get('index = customer_company');
var defaultCompany = uiRegistry.get('index = extension_attributes.company_attributes.company_id');
var customerUsername = uiRegistry.get('index = customer_username');
var password = uiRegistry.get('index = password');
var cnfpassword = uiRegistry.get('index = confirm_password');
if (value != 1)
customerCompany.show();
defaultCompany.hide();
customerUsername.show();
password.show();
cnfpassword.show();
else
customerCompany.hide();
defaultCompany.show();
customerUsername.hide();
password.hide();
cnfpassword.hide();
return this._super();
,
);
);
Thanks for the response. After making the abover mentioned changes now I am getting the error "Cannot read property 'show' of undefined".
– Meetali Gupta
2 days ago
it means selector on which you are using show() method is undefine, means you didnt get selector using uiRegistry
– Satish Dubariya
yesterday
But it works on the second reload.
– Meetali Gupta
yesterday
add a comment |
Change position of jquery components in define()
as below:
define([
'jquery',
'underscore',
'uiRegistry',
'Magento_Ui/js/form/element/select',
'jquery/ui',
'mage/url'
], function ($, _, uiRegistry, Select)
'use strict';
return function (Select)
return Select.extend(
initialize: function (value)
this._super();
var customerCompany = uiRegistry.get('index = customer_company');
var defaultCompany = uiRegistry.get('index = extension_attributes.company_attributes.company_id');
var vessels = uiRegistry.get('index = customer_vessels');
var customerUsername = uiRegistry.get('index = customer_username');
var password = uiRegistry.get('index = password');
var cnfpassword = uiRegistry.get('index = confirm_password');
if (this.value() != 1)
customerCompany.show();
defaultCompany.hide();
vessels.show();
customerUsername.show();
password.show();
cnfpassword.show();
else
customerCompany.hide();
defaultCompany.show();
vessels.hide();
customerUsername.hide();
password.hide();
cnfpassword.hide();
return this;
,
onUpdate: function (value)
var customerCompany = uiRegistry.get('index = customer_company');
var defaultCompany = uiRegistry.get('index = extension_attributes.company_attributes.company_id');
var customerUsername = uiRegistry.get('index = customer_username');
var password = uiRegistry.get('index = password');
var cnfpassword = uiRegistry.get('index = confirm_password');
if (value != 1)
customerCompany.show();
defaultCompany.hide();
customerUsername.show();
password.show();
cnfpassword.show();
else
customerCompany.hide();
defaultCompany.show();
customerUsername.hide();
password.hide();
cnfpassword.hide();
return this._super();
,
);
);
Thanks for the response. After making the abover mentioned changes now I am getting the error "Cannot read property 'show' of undefined".
– Meetali Gupta
2 days ago
it means selector on which you are using show() method is undefine, means you didnt get selector using uiRegistry
– Satish Dubariya
yesterday
But it works on the second reload.
– Meetali Gupta
yesterday
add a comment |
Change position of jquery components in define()
as below:
define([
'jquery',
'underscore',
'uiRegistry',
'Magento_Ui/js/form/element/select',
'jquery/ui',
'mage/url'
], function ($, _, uiRegistry, Select)
'use strict';
return function (Select)
return Select.extend(
initialize: function (value)
this._super();
var customerCompany = uiRegistry.get('index = customer_company');
var defaultCompany = uiRegistry.get('index = extension_attributes.company_attributes.company_id');
var vessels = uiRegistry.get('index = customer_vessels');
var customerUsername = uiRegistry.get('index = customer_username');
var password = uiRegistry.get('index = password');
var cnfpassword = uiRegistry.get('index = confirm_password');
if (this.value() != 1)
customerCompany.show();
defaultCompany.hide();
vessels.show();
customerUsername.show();
password.show();
cnfpassword.show();
else
customerCompany.hide();
defaultCompany.show();
vessels.hide();
customerUsername.hide();
password.hide();
cnfpassword.hide();
return this;
,
onUpdate: function (value)
var customerCompany = uiRegistry.get('index = customer_company');
var defaultCompany = uiRegistry.get('index = extension_attributes.company_attributes.company_id');
var customerUsername = uiRegistry.get('index = customer_username');
var password = uiRegistry.get('index = password');
var cnfpassword = uiRegistry.get('index = confirm_password');
if (value != 1)
customerCompany.show();
defaultCompany.hide();
customerUsername.show();
password.show();
cnfpassword.show();
else
customerCompany.hide();
defaultCompany.show();
customerUsername.hide();
password.hide();
cnfpassword.hide();
return this._super();
,
);
);
Change position of jquery components in define()
as below:
define([
'jquery',
'underscore',
'uiRegistry',
'Magento_Ui/js/form/element/select',
'jquery/ui',
'mage/url'
], function ($, _, uiRegistry, Select)
'use strict';
return function (Select)
return Select.extend(
initialize: function (value)
this._super();
var customerCompany = uiRegistry.get('index = customer_company');
var defaultCompany = uiRegistry.get('index = extension_attributes.company_attributes.company_id');
var vessels = uiRegistry.get('index = customer_vessels');
var customerUsername = uiRegistry.get('index = customer_username');
var password = uiRegistry.get('index = password');
var cnfpassword = uiRegistry.get('index = confirm_password');
if (this.value() != 1)
customerCompany.show();
defaultCompany.hide();
vessels.show();
customerUsername.show();
password.show();
cnfpassword.show();
else
customerCompany.hide();
defaultCompany.show();
vessels.hide();
customerUsername.hide();
password.hide();
cnfpassword.hide();
return this;
,
onUpdate: function (value)
var customerCompany = uiRegistry.get('index = customer_company');
var defaultCompany = uiRegistry.get('index = extension_attributes.company_attributes.company_id');
var customerUsername = uiRegistry.get('index = customer_username');
var password = uiRegistry.get('index = password');
var cnfpassword = uiRegistry.get('index = confirm_password');
if (value != 1)
customerCompany.show();
defaultCompany.hide();
customerUsername.show();
password.show();
cnfpassword.show();
else
customerCompany.hide();
defaultCompany.show();
customerUsername.hide();
password.hide();
cnfpassword.hide();
return this._super();
,
);
);
answered 2 days ago
Satish DubariyaSatish Dubariya
419112
419112
Thanks for the response. After making the abover mentioned changes now I am getting the error "Cannot read property 'show' of undefined".
– Meetali Gupta
2 days ago
it means selector on which you are using show() method is undefine, means you didnt get selector using uiRegistry
– Satish Dubariya
yesterday
But it works on the second reload.
– Meetali Gupta
yesterday
add a comment |
Thanks for the response. After making the abover mentioned changes now I am getting the error "Cannot read property 'show' of undefined".
– Meetali Gupta
2 days ago
it means selector on which you are using show() method is undefine, means you didnt get selector using uiRegistry
– Satish Dubariya
yesterday
But it works on the second reload.
– Meetali Gupta
yesterday
Thanks for the response. After making the abover mentioned changes now I am getting the error "Cannot read property 'show' of undefined".
– Meetali Gupta
2 days ago
Thanks for the response. After making the abover mentioned changes now I am getting the error "Cannot read property 'show' of undefined".
– Meetali Gupta
2 days ago
it means selector on which you are using show() method is undefine, means you didnt get selector using uiRegistry
– Satish Dubariya
yesterday
it means selector on which you are using show() method is undefine, means you didnt get selector using uiRegistry
– Satish Dubariya
yesterday
But it works on the second reload.
– Meetali Gupta
yesterday
But it works on the second reload.
– Meetali Gupta
yesterday
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f270933%2fcannot-read-property-get-of-undefined%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown