1

Help me to add the multiple fields in single row of magento 2 edit form backend/admin..

for example:

I have two fields First name & Last Name which I want in same row.

0

You add like following

<container name="name_group">
            <argument name="data" xsi:type="array">
                <item name="type" xsi:type="string">group</item>
                <item name="config" xsi:type="array">
                    <item name="additionalClasses" xsi:type="string">admin__control-grouped-date</item>
                    <item name="component" xsi:type="string">Magento_Ui/js/form/components/group</item>
                    <item name="label" xsi:type="string" translate="true">Monday</item>
                    <item name="required" xsi:type="boolean">false</item>
                    <item name="sortOrder" xsi:type="number">220</item>
                    <item name="breakLine" xsi:type="boolean">false</item>
                    <item name="scopeLabel" xsi:type="string">[STORE VIEW]</item>
                </item>
            </argument>
            <field name="first_name">
                <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                        <item name="label" xsi:type="string" translate="true">Full Name</item>
                        <item name="additionalClasses" xsi:type="string">admin__field-first-name</item>
                        <item name="sortOrder" xsi:type="number">230</item>
                        <item name="dataType" xsi:type="string">string</item>
                        <item name="formElement" xsi:type="string">textarea</item>
                        <item name="scopeLabel" xsi:type="string">[STORE VIEW]</item>
                        <item name="dataScope" xsi:type="string">first_name</item>
                    </item>
                </argument>
            </field>
            <field name="last_name">
                <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                        <item name="additionalClasses" xsi:type="string">admin__field-last-name</item>
                        <item name="sortOrder" xsi:type="number">240</item>
                        <item name="dataType" xsi:type="string">string</item>
                        <item name="formElement" xsi:type="string">textarea</item>
                        <item name="scopeLabel" xsi:type="string">[STORE VIEW]</item>
                        <item name="dataScope" xsi:type="string">last_name</item>
                    </item>
                </argument>
            </field>
        </container>
  • it does not work when I am adding input box and a button on same line..do you have any solution for that? – ANKIT 2 days ago

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.