magento-2-admin-ui icon indicating copy to clipboard operation
magento-2-admin-ui copied to clipboard

Can't sort dynamic rows

Open UpSage opened this issue 6 months ago • 5 comments

Hi,

First of all thank you for the very nice module. It made my custom widgets looked very easy and beautiful.

I only have concern regarding dynamic rows. I know that I can drag it from the admin, but if I'm saving it, its not really saving and does not make any effect. Any chance that it can be fixed?

I'm using Magento 2.4.6 also this is the module that I am building:

https://github.com/UpSage/SlickSliderWidget/tree/update/initial

I hope I can get a reponse.

Thank you

UpSage avatar Dec 22 '23 00:12 UpSage

Hello UpSage. This has been fixed. Please update the module to version 1.0.3 and add the following field position to your dynamicRow component.

<field name="position" component="Magento_Catalog/js/form/element/input" formElement="input">
       <settings>
               <visible>false</visible>
       </settings>
</field>

graschik avatar Jan 03 '24 13:01 graschik

Hi @graschik . Thank you so much. I have tested it and it works

UpSage avatar Jan 04 '24 11:01 UpSage

Hi @graschik ,

There's another bug. If you add a delete button to the dynamic rows, the row won't delete if there is a position field. The loader keeps spinning.

<field name="position" component="Magento_Catalog/js/form/element/input" formElement="input">
     <settings>
      <visible>false</visible>
     </settings>
    </field>
    
    <actionDelete template="Magento_Backend/dynamic-rows/cells/action-delete">
     <argument name="data" xsi:type="array">
      <item name="config" xsi:type="array">
       <item name="fit" xsi:type="boolean">true</item>
      </item>
     </argument>
     <settings>
      <dataType>text</dataType>
      <label>Actions</label>
      <componentType>actionDelete</componentType>
     </settings>
    </actionDelete> 

UpSage avatar Jan 10 '24 20:01 UpSage

Got it working using this instead:

<field name="position" formElement="input">
 <settings>
  <visible>false</visible>
 </settings>
</field>

Sorts and can be deleted without issues

UpSage avatar Jan 26 '24 19:01 UpSage

Thank you UpSage

graschik avatar Jan 31 '24 09:01 graschik