joomla-cms icon indicating copy to clipboard operation
joomla-cms copied to clipboard

[5.2] Subform Grid layout, an alternative for unresponsive Table layout

Open Fedik opened this issue 2 years ago • 1 comments

Pull Request for Issue https://github.com/joomla/joomla-cms/issues/29241.

Summary of Changes

Adds a new layout that rendering subforms fields in Grid (which partially mimic the table look). Wich make it more responsive.

It is not 1:1 replacement for table, here is no headers and the labels is rendered within the input. But in most cases should be good for such views.

Testing Instructions

Run npm install Create subform field somewhere:

<field type="subform" name="subform1" label="subform1" multiple="true" 
layout="joomla.form.field.subform.repeatable-grid">
    <form>
            <field type="text" name="text" label="Text"/>
            <field type="text" name="text2" label="Text2"/>
            <field type="text" name="text3" label="Text3"/>
    </form>
</field>
<field type="subform" name="subform2" label="subform2" multiple="true" groupByFieldset="true"  
layout="joomla.form.field.subform.repeatable-grid">
    <form>
        <fieldset name="set1" label="Set 1">
            <field type="text" name="text" label="Text"/>
        </fieldset>
        <fieldset name="set2" label="Set 1">
            <field type="text" name="text2" label="Text2"/>
            <field type="text" name="text3" label="Text3"/>
        </fieldset>
    </form>
</field>

And check that it looks good on small and normal screens.

Also try edit the Custom field options for List field in backend, with browser width around 1000-1200px

Actual result BEFORE applying this Pull Request

The options input for List field is cutted:

Screenshot 2023-11-12_16-46-40

Expected result AFTER applying this Pull Request

Testing field works.

The options input for List field looks good: Screenshot 2023-11-12_16-46-16

Link to documentations

Please select:

  • [ ] Documentation link for docs.joomla.org: https://docs.joomla.org/Subform_form_field_type
  • [ ] No documentation changes for docs.joomla.org needed
  • [ ] Pull Request link for manual.joomla.org: TBD
  • [ ] No documentation changes for manual.joomla.org needed

Please write your opinions. Do we need this, do we do it in this way or should be something else. Thanks!

Fedik avatar Nov 15 '23 11:11 Fedik

@Fedik tested in an own component and really like it.

My subform in three variants after Patch: repeatable, repeatable-grid and repeatable-table

grafik

chmst avatar Nov 28 '23 12:11 chmst

This pull request has been automatically rebased to 5.3-dev.

HLeithner avatar Sep 02 '24 08:09 HLeithner