i’m utilizing Magento 2.2.x ,i’ve added a brand new column which is a joined column between two desk , i can show his information and all work positive and like a attraction, however when I attempt to filter by this column it did not work for me , can anybody inform me the place is the issue right here i shall be grateful 🙂
my code and my tables is beneath :
right here is my Assortment.php
protected perform _initSelect()
{
mother or father::_initSelect();
$this
->be a part of(
['dealer' => $this->getTable('amasty_perm_dealer')],
'seller.entity_id = main_table.dealer_id',
['city' => 'main_table.city']
);
$this->addFilterToMap('metropolis', 'main_table.metropolis');
return $this;
}
right here is the block :
<?xml model="1.0"?>
<web page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Format/and so on/page_configuration.xsd">
<physique>
<referenceBlock identify="adminhtml.consumer.grid.container">
<referenceBlock identify="adminhtml.consumer.grid">
<referenceBlock identify="permission.consumer.grid.columnSet">
<block class="MagentoBackendBlockWidgetGridColumn" as="metropolis" earlier than="permission.consumer.grid.columnSet.is_active">
<arguments>
<argument identify="header" xsi:kind="string" translate="true">Metropolis</argument>
<argument identify="kind" xsi:kind="string">textual content</argument>
<argument identify="renderer" xsi:kind="string">MymoduleDealerBlockAdminhtmlDealerGridDealerCity</argument>
</arguments>
</block>
</referenceBlock>
</referenceBlock>
</referenceBlock>
</physique>
</web page>
and right here is the 2 tables
-
main_table :
-
seller desk :