Uncaught TypeError: Cannot read property 'options' of undefined
I am making an ajax call when an Ui Component field 'attribute_id' is changed.
I would like to populate the other field "attribute_value_id".
However I am getting an error:
Uncaught TypeError: Cannot read property 'options' of undefined
Would you suggest what is wrong with this code?
My code is :
The form "item_form.xml"
HTML Code:
<field name="attribute_id">
<argument name="data" xsi:type="array">
<item name="options" xsi:type="object">Vendor\Module\Model\Source\Myvalues</item>
<item name="config" xsi:type="array">
<item name="dataType" xsi:type="string">text</item>
<item name="label" translate="true" xsi:type="string">Attribute</item>
<item name="component" xsi:type="string">Vendor_Module/js/form/element/options</item>
<item name="formElement" xsi:type="string">select</item>
<item name="sortOrder" xsi:type="number">210</item>
</item>
</argument>
</field>
<field name="attribute_value_id" >
<argument name="data" xsi:type="array">
<item name="options" xsi:type="object">Vendor\Module\Model\Source\Myvalues</item>
<item name="config" xsi:type="array">
<item name="dataType" xsi:type="string">text</item>
<item name="label" translate="true" xsi:type="string">Attribute Value</item>
<item name="component" xsi:type="string">Vendor_Module/js/form/element/options</item>
<item name="formElement" xsi:type="string">select</item>
<item name="sortOrder" xsi:type="number">211</item>
</item>
</argument>
</field>
View more threads in the same category:
Bookmarks