I’am working on a module where I need to filer store view which is stored as comma separated values in a custom table. I tried solutions mentioned in Magento 2 -Admin Grid Select filter with comma separated values but it is not even getting into my collections file for filter, meaning any changes in collection (including exit() is not getting reflected). Can anyone please help here.
di.xml
<arguments>
<argument name="mainTable" xsi:type="string">callcenter_products</argument>
<argument name="resourceModel" xsi:type="string">VendorModuleModelResourceModelProducts</argument>
</arguments>
</virtualType>
<type name="MagentoFrameworkViewElementUiComponentDataProviderCollectionFactory">
<arguments>
<argument name="collections" xsi:type="array">
<item name="callcenter_manage_products_grid_data_source" xsi:type="string">VendorModuleModelResourceModelProductsGridCollection</item>
</argument>
</arguments>
</type>
uicomponent (store view part alone)
<argument name="data" xsi:type="array">
<item name="options" xsi:type="object">MagentoStoreUiComponentListingColumnStoreOptions</item>
<item name="config" xsi:type="array">
<item name="filter" xsi:type="string">select</item>
<item name="component" xsi:type="string">Magento_Ui/js/grid/columns/select</item>
<item name="dataType" xsi:type="string">select</item>
<item name="label" xsi:type="string" translate="true">Store View</item>
<item name="bodyTmpl" xsi:type="string">ui/grid/cells/html</item>
</item>
</argument>
</column>
Collection.php
namespace VendorModuleModelResourceModelProducts;
class Collection extends MagentoFrameworkModelResourceModelDbCollectionAbstractCollection
{
/**
* @var string
*/
protected $_idFieldName = 'id';
/**
* Define resource model
*
* @return void
*/
protected function _construct()
{ exit;
$this->_init('VendorModuleModelProducts', 'VendorModuleModelResourceModelProducts');
}
}