0

I am developing a Module which have functionality to display,add,edit data in Grid from custom table.

I have inserted some data in table manually and with the help of di.xml and ui component xml,data is showing correctly without Model and Resource Model.

So is this possible to display data without Model and ResourceModel and Collection files?

Please see below di.xml file

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">

    <virtualType name="Vendorname\Modulename\Model\ResourceModel\Grid\Grid\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
        <arguments>
            <argument name="mainTable" xsi:type="string">manage_data</argument>
<!--
            <argument name="resourceModel" xsi:type="string">Vendorname\Modulename\Model\ResourceModel\Grid</argument>
-->
        </arguments>
    </virtualType>
    <type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
        <arguments>
            <argument name="collections" xsi:type="array">
                <item name="grid_record_grid_list_data_source" xsi:type="string">Vendorname\Modulename\Model\ResourceModel\Grid\Grid\Collection</item>
            </argument>
        </arguments>
    </type>
</config>

Please help me that how is possible this?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.