Can anyone please show me an example of creating dynamic rows using "Data Provider" in Magento 2, like the Tire price creations in the screenshot
1 Answer
Below I have added works Dynamic Rows functionality as an extension. You can copy it and customize it to your needs.
You can check code in my repo here.
Description and how extension works you can find here.
-
You should copy relevant information from the links into your answer in case of link rot. Commented May 17, 2023 at 15:05
-
Do you think I should maintain the repo based on the data from the article? I don't think so. I just provided a working example for Dynamic Rows, anybody can install it and test it. It's not an extension that anybody recommends using in production, just a sample that is provided for development purposes.– bakalovCommented May 20, 2023 at 9:47
-
No offense intended, just a suggestion from the policy: “Always quote the most relevant part of an important link, in case the external resource is unreachable or goes permanently offline. Links to other websites should always be helpful, but avoid making it necessary to click on them as much as possible.” (magento.stackexchange.com/help/how-to-answer). Commented May 20, 2023 at 13:08
-
Thank you for this reference to the policy. But I still don't understand what the issue is. I refactored that code and added some fixes, so the description, in general, is still actual, but the code base has been changed a little bit, based on the Magento best practices.– bakalovCommented May 21, 2023 at 15:01
-
It’s a valuable resource no doubt about that. My suggestion, based on the policy, is just to also quote the most important concepts in the answer here. It can be updated in light of new best practices too. Thanks for contributing! Commented May 21, 2023 at 22:50
magento\vendor\magento\module-catalog\Ui\DataProvider\Product\Form\Modifier\AdvancedPricing.php
. Not able to get perfect answer