I have created a grid with UI component with one table now I want to join another table so how can I create??
i try but not working
in
Vendorname\Modulename\Model\ResourceModel\Quote\collection.php
protected function _initSelect()
{
parent::_initSelect();
$this->getSelect()->joinLeft(
['secondTable' => $this->getTable('quote_customer')],
'main_table.mcs_quote_id = secondTable.quote_request_id',
array('*')
);
}
Best Answer
You can display values from join two tables by using below model resource collection class function
Add below function to your model resource collection function
You can get more information from here magento2: admin grid showing joined table