0
<?xml version="1.0" encoding="UTF-8"?>

<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
   <argument name="data" xsi:type="array">
   <item name="js_config" xsi:type="array">
       <item name="provider" xsi:type="string">product_form.product_form_data_source</item>
       <item name="namespace" xsi:type="string">gift_form</item>
   </item>
   <item name="template" 
xsi:type="string">templates/form/collapsible</item>
</argument>
<settings> 
    <deps>
        <dep>product_form.product_form_data_source</dep>
    </deps>
</settings>
<dataSource name="product_form_data_source">
    <argument name="data" xsi:type="array">
        <item name="js_config" xsi:type="array">
            <item name="component" 
xsi:type="string">Magento_Ui/js/form/provider</item>
        </item>
    </argument>
   <dataProvider 
class="
Namespace\Producttype\Ui\DataProvider\Product\Form\GiftAmountDataProvider" 
name="product_form_data_source">
        <settings>
            <requestFieldName>id</requestFieldName>
            <primaryFieldName>card_amount_productid</primaryFieldName>
        </settings>
    </dataProvider>
</dataSource>
<fieldset name="dynamic_rows_set">
   <argument name="data" xsi:type="array">
       <item name="config" xsi:type="array">
           <item name="label" xsi:type="string" translate="true">Gift 
       Card Price Settings</item>
          <item name="collapsible" xsi:type="boolean">true</item>
           <item name="sortOrder" xsi:type="number">4</item>
       </item>
   </argument>
   <container name="dynamic_rows_container">
       <argument name="data" xsi:type="array">
           <item name="config" xsi:type="array">
               <item name="component" xsi:type="string">Magento_Ui/js/dynamic-rows/dynamic-rows</item>
               <item name="template" xsi:type="string">ui/dynamic-rows/templates/default</item>
               <item name="componentType" xsi:type="string">dynamicRows</item>
               <item name="recordTemplate" xsi:type="string">record</item>
               <item name="addButtonLabel" xsi:type="string">Add New</item>
               <item name="deleteProperty" xsi:type="boolean">false</item>
           </item>
       </argument>
       <container name="record">
           <argument name="data" xsi:type="array">
               <item name="config" xsi:type="array">
                   <item name="label" xsi:type="string" translate="true">Gift Card Price Settings</item>
                   <item name="component" xsi:type="string" translate="true">Magento_Ui/js/dynamic-rows/record</item>
                   <item name="isTemplate" xsi:type="boolean">true</item>
                   <item name="is_collection" xsi:type="boolean">true</item>
                   <item name="showFallbackReset" xsi:type="boolean">false</item>
               </item>
           </argument>
           <field name="card_amount_value">
               <argument name="data" xsi:type="array">
                   <item name="config" xsi:type="array">
                       <item name="dataType" xsi:type="string">text</item>
                       <item name="label" xsi:type="string" translate="true">Amount</item>
                       <item name="formElement" xsi:type="string">input</item>
                       <item name="showFallbackReset" xsi:type="boolean">false</item>
                       <item name="validation" xsi:type="array">
                           <item name="required-entry" xsi:type="boolean">true</item>
                       </item>
                       <item name="sortOrder" xsi:type="string">10</item>

                   </item>

               </argument>

           </field>

           <actionDelete>

               <argument name="data" xsi:type="array">

                   <item name="config" xsi:type="array">

                       <item name="componentType" xsi:type="string">actionDelete</item>

                       <item name="dataType" xsi:type="string">text</item>

                       <item name="fit" xsi:type="boolean">false</item>

                       <item name="label" xsi:type="string">Actions</item>

                       <item name="additionalClasses" xsi:type="string">data-grid-actions-cell</item>

                       <item name="template" xsi:type="string">Magento_Backend/dynamic-rows/cells/action-delete</item>

                   </item>

               </argument>

           </actionDelete>
       </container>

     </container>

 </fieldset>

</form>
  • Please try to elaborate clearly what issue you are facing, and also the steps to re-produce that by others if possible. As it stands, it's not possible to figure this out from current description. – Prateek Apr 24 at 14:48
  • I crated custom dynamic rows in product add/edit page. I can save dynamic rows values to to custom table with foreign key productid. But i cannot render that dynamically created values to product edit page. When use '<dataSource name="gift_form_data_source">' tag i can load dynamic rows values. But all other produ t deatils will be blank. That is the issue. – harif Apr 25 at 5:53

Your Answer

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

Browse other questions tagged or ask your own question.