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

| improve this question | | | | |
  • Hi jaisa, Have you found any solution for that? – krupa parikh Apr 10 '19 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 '19 at 4:06
  • Do you know about how to update data in ui select dropdown? – Niket Nov 9 '19 at 5:34
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.

| improve this answer | | | | |
  • Thanks for you reply,I will check and let u know – Jaisa Nov 11 '19 at 5:56

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.