In your Model Collection file you can use _renderFiltersBefore()
method. like below i used.
protected function _renderFiltersBefore() {
$filters = $this->request->getParam('filters');
if (isset($filters['customer_id'])) { // your filter index in which you want filter callback
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$customers = $objectManager->get('My\Custom\Model\MyModel')->create()
->getCollection()
->addAttributeToFilter('email', ['like' => '%' . $filters['customer_id'] . '%']);
$customer_id = array();
foreach ($customers as $customer) {
$customer_id[] = $customer->getId();
$this->getSelect()->orWhere("main_table.customer_id = '" . $customer->getId() . "'");
}
}
parent::_renderFiltersBefore();
}
thanks