5

I need to create backend admin form which contains two dropdown fields.But One is dependent on other. One dropdown contains attributes like brand,color etc.. The second one contains associate options of the attribute what you select in the first dropdown. If you select Brand, It should show all the available brands in second dropdown.

enter image description here

If you select color It would show all the available colors in the second dropdown enter image description here

Is above scenario is possible in ui-component form in magento 2. Please suggest me, Am I need to create ui-component form or php form to do my task. Thanks in advance

  • Hi jaisa, Have you found any solution for that? – krupa parikh Apr 10 at 19:38
  • @krupaparikh, I done this using layout grid instead of using ui component. In layout grid you can add template for the specific field. If you have doubts let me know thanks – Jaisa Apr 11 at 4:06
1

Please check example

https://github.com/Ximbo/magento2-dependent-fields

This example uses attributes color and manufaturer (as defined in di.xml). Also it does not cover dataProvider usage and other things related to the ui component. Just about dependent selects.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.