4

I want to have a custom Grid in Admin Form tab using ui_component .

Here is my Grid ui_component for tab fieldset.

<fieldset name="assign_applicants">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">Applicants</item>
                <item name="collapsible" xsi:type="boolean">true</item>
                <item name="sortOrder" xsi:type="number">30</item>
            </item>
        </argument>
        <container name="assign_products_container" >
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="sortOrder" xsi:type="number">160</item>
                </item>
            </argument>
            <htmlContent name="html_content">
                <argument name="block" xsi:type="object">Package_Name\Module\Block\Adminhtml\Job\AssignApplicants</argument>
            </htmlContent>
        </container>
    </fieldset>

1 Answer 1

6

In your <fieldset> section you could use <insertListing>.

    <fieldset name="assign_applicants">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">Applicants</item>
                <item name="collapsible" xsi:type="boolean">true</item>
                <item name="sortOrder" xsi:type="number">30</item>
            </item>
        </argument>
        <insertListing>
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="autoRender" xsi:type="boolean">true</item>
                    <item name="ns" xsi:type="string">applicants_form_listing</item>
                </item>
            </argument>
        </insertListing>
    </fieldset>

In the ns config you specify the listing UI component's name. Then you define this component separately in the view/adminhtml/ui_component/applicants_form_listing.xml and describe what should be in the grid (you can check this thread for details).

2
  • It is working but it is not send data to controller. Commented Mar 30, 2019 at 6:18
  • @dan.Kocherga how do i filter applicants_form_listing grid content based on ui form id?
    – Ashar Riaz
    Commented Feb 17, 2023 at 13:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.