Question

I want to show customers grid in our custom admin form where I can select a particular customer so how to get this customer grid list in our form?

Was it helpful?

Solution

We need to add few lines in your ui componnet form file as follows

 <insertListing name="customer_custom_listing">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="dataLinks" xsi:type="array">
                        <item name="imports" xsi:type="boolean">false</item>
                        <item name="exports" xsi:type="boolean">false</item>
                    </item>
                    <item name="autoRender" xsi:type="boolean">true</item>
                    <item name="behaviourType" xsi:type="string">simple</item>
                    <item name="ns" xsi:type="string">customer_custom_listing</item>
                    <item name="render_url" xsi:type="url" path="mui/index/render"/>
                    <item name="filter_url_params" xsi:type="array">
                        <!-- You can add as many as you want -->
                        <item name="id" xsi:type="string">${ $.provider }:data.entity_id</item>
                    </item>
                    <item name="selectProvider" xsi:type="string">customer_custom_listing.customer_custom_listing.columns.ids</item>
                    <item name="storageConfig" xsi:type="array">
                        <item name="indexField" xsi:type="string">id</item>
                    </item>

                </item>
            </argument>
        </insertListing>

Here You can see I have added customer_custom_listing in my form and added new customer_custom_listing.xml file for additional customization

you can add any existing listing using this component

hope this may help you.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top