In ui form, I set 2 dropdown field. Now, I want to do something like that in second dropdown value set based on first dropdown selected value.
For ex : In Customer module, There are country region dropdown field. In country If you select "United States" then, in region will display "United States" country's region.
I want to do same as like in my custom dropdown with ui-select dropdown. How to do that?
I figure out that i think it's working by this below code :
<item name="filterBy" xsi:type="array">
<item name="target" xsi:type="string">${ $.provider }:${ $.parentScope }.country</item><!-- 'country' - db table column name where country code is saved -->
<item name="field" xsi:type="string">country_id</item><!-- country_id field name -->
</item>
But, how it works?
Any help would be highly appreciated !!
Best Answer
Vendorename\Modulename\Ui\Component\Create\Form\Customer
CustomerOptions.php
Vendorename\Modulename\Model
Mapper.php
Now we add Jquery files
Vendorename/Modulename/view/adminhtml/web/js/components
select-customer.js
Vendorename/Modulename/view/adminhtml/web/js/components
select-order