1

In Magento 2.2.5, I am using datasource in the grid and it is working fine.

I want to use the same datasource in another grid with some filters. I am using vendorname_module_deal_listing_data_source again in the another grid. But it is keeps loading. I cannot find any errors in console and log anywhere. Code of di.xml is:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
    <arguments>
        <argument name="collections" xsi:type="array">
            <item name="vendorname_module_deal_listing_data_source" xsi:type="string">Vendorname\Module\Model\ResourceModel\Deal\Collection</item>
        </argument>
    </arguments>
</type>
<virtualType name="Vendorname\Module\Model\ResourceModel\Deal\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
    <arguments>
        <argument name="mainTable" xsi:type="string">module_manage_deal</argument>
        <argument name="resourceModel" xsi:type="string">Vendorname\Module\Model\ResourceModel\Deal</argument>
    </arguments>
</virtualType>

Update:

admin layout Code: https://pastebin.com/ZRw0ug9D

Screenshot: https://prnt.sc/kzqzov

Working Grid's UI Component: https://pastebin.com/Lb7QZmUt

Copied Grid's UI Component: https://pastebin.com/i3DXVita

13
  • so what is the issue? Sep 28, 2018 at 10:17
  • I want to use same datasource in another grid. But it is keeps loading Sep 28, 2018 at 10:23
  • Can you add screenshot what you facing and please add code where you have used vendorname_module_deal_listing_data_source in another module Sep 28, 2018 at 10:25
  • @RutveeSojitra Pls check my updated code. Sep 28, 2018 at 10:29
  • I don't think so this is the right way.... in another module where in ui_component folder in xml file you need to add that datasource Sep 28, 2018 at 10:31

1 Answer 1

0

As per your original data source name:

In both file data source name should be same like below:

                   <argument name="name" xsi:type="string">vendorname_module_deal_listing_data_source</argument>

but in copied code i am found diff datasource name:

        <argument name="name" xsi:type="string">vendorname_customergroup_deal_listing_data_source</argument>

Can you please check and make it same

Your Answer

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

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