Magento Expert Forum - Improve your Magento experience

Results 1 to 2 of 2

Uicomponent Ajax

  1. #1
    New member
    Join Date
    Sep 2018
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Talking Uicomponent Ajax

    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:


  2. #2
    Junior Member
    Join Date
    Sep 2018
    Location
    Oman, Muscat
    Posts
    2,084
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Default

    I am making a structure utilizing UiComponent. In options.js, I might want to make an ajax call. Anyway It's getting 404 not discovered mistake. I might want to.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •