Need to create an admin grid on Magento 2 with data of two custom tables of different structures.
FYI, unable to proceed with joins and union.
Can you please anyone provide the best solution to achieve this?.
admingridmagento-2.2.5magento2uicomponent
Need to create an admin grid on Magento 2 with data of two custom tables of different structures.
FYI, unable to proceed with joins and union.
Can you please anyone provide the best solution to achieve this?.
Best Answer
Follow the instructions mentioned in this article to create the grid.
Now, follow these steps:
To join, you have to add the following codes in di.xml file:
Then you have to update Collection.php file in app/code/Webkul/Grid/Model/ResourceModel/Grid/Collection.php with the following codes:
You can find more information about these steps right here.