As i correct understand, you are using UI Component. Following example how to add multiply SKU filter on product grid. I hope you can properly add to your custom grid
Acme/StackExchange/view/adminhtml/ui_component/product_listing.xml
<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<listingToolbar name="listing_top">
<filters name="listing_filters">
<filterInput name="sku" template="ui/grid/filters/field" class="Acme\StackExchange\Ui\Component\Listing\Filter\Sku" provider="${ $.parentName }">
<settings>
<dataScope>sku</dataScope>
<label translate="true">SKU</label>
</settings>
</filterInput>
</filters>
</listingToolbar>
<!-- Reset default filter. Just don't define filter in your column -->
<columns name="product_columns">
<column name="sku">
<settings>
<filter>false</filter>
</settings>
</column>
</columns>
</listing>
Acme/StackExchange/Ui/Component/Listing/Filter/Sku.php
<?php
declare(strict_types=1);
namespace Acme\StackExchange\Ui\Component\Listing\Filter;
use Magento\Ui\Component\Filters\Type\Input;
class Sku extends Input
{
/**
* @inheridoc
*/
protected function applyFilter(): void
{
if (isset($this->filterData[$this->getName()])) {
$value = explode(',', $this->filterData[$this->getName()]);
$value = array_map('trim', $value);
$filter = $this->filterBuilder->setConditionType('in')
->setField('sku')
->setValue($value)
->create();
$this->getContext()->getDataProvider()->addFilter($filter);
}
}
}
[Update]
In example with use logic with reset filter your module should depends on original logic. In this example:
Acme/StackExchange/etc/module.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Acme_StackExchange">
<sequence>
<module name="Magento_Catalog"/>
</sequence>
</module>
</config>
Example with the same logic, but with custom filter name
Acme/StackExchange/view/adminhtml/ui_component/product_listing.xml
<?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<listingToolbar name="listing_top">
<filters name="listing_filters">
<filterInput name="sku_list" template="ui/grid/filters/field" class="Acme\StackExchange\Ui\Component\Listing\Filter\Sku" provider="${ $.parentName }">
<settings>
<dataScope>sku_list</dataScope>
<label translate="true">SKU (comma)</label>
</settings>
</filterInput>
</filters>
</listingToolbar>
</listing>
Result

joelbutcher/facebook-graph-sdk