Skip to main content
added 55 characters in body
Source Link
Kamal Jain
  • 201
  • 2
  • 4

you need to make change in di.xml file.

Replace this Line: Company\Module\Model\ResourceModel\Test\Collection

Replace With this: Company\Module\Model\ResourceModel\Test\Grid\Collection

In virtual type: you need to add \Grid\ before collection

<virtualType name="Company\Module\Model\ResourceModel\Test\Grid\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">

Same in type:

<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="company_module_listing_data_source" xsi:type="string">Company\Module\Model\ResourceModel\Test\Grid\Collection</item>
            </argument>
        </arguments>
    </type>

Run the command : php bin/magento setup:di:compile

you need to make change in di.xml file.

Replace this Line: Company\Module\Model\ResourceModel\Test\Collection

Replace With this: Company\Module\Model\ResourceModel\Test\Grid\Collection

In virtual type: you need to add \Grid\ before collection

<virtualType name="Company\Module\Model\ResourceModel\Test\Grid\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">

Same in type:

<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="company_module_listing_data_source" xsi:type="string">Company\Module\Model\ResourceModel\Test\Grid\Collection</item>
            </argument>
        </arguments>
    </type>

you need to make change in di.xml file.

Replace this Line: Company\Module\Model\ResourceModel\Test\Collection

Replace With this: Company\Module\Model\ResourceModel\Test\Grid\Collection

In virtual type: you need to add \Grid\ before collection

<virtualType name="Company\Module\Model\ResourceModel\Test\Grid\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">

Same in type:

<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="company_module_listing_data_source" xsi:type="string">Company\Module\Model\ResourceModel\Test\Grid\Collection</item>
            </argument>
        </arguments>
    </type>

Run the command : php bin/magento setup:di:compile

Source Link
Kamal Jain
  • 201
  • 2
  • 4

you need to make change in di.xml file.

Replace this Line: Company\Module\Model\ResourceModel\Test\Collection

Replace With this: Company\Module\Model\ResourceModel\Test\Grid\Collection

In virtual type: you need to add \Grid\ before collection

<virtualType name="Company\Module\Model\ResourceModel\Test\Grid\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">

Same in type:

<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="company_module_listing_data_source" xsi:type="string">Company\Module\Model\ResourceModel\Test\Grid\Collection</item>
            </argument>
        </arguments>
    </type>