I created custom admin grid with filters. But when I enter 0 in "from field" in filter - in the results it shows items with negative values also, so it does not work right.
I found this function in magento core
vendor\magento\module-ui\Component\Filters\Type\Range.php
protected function applyFilterByType($type, $value)
{
if (!empty($value) && $value !== '0') {
$filter = $this->filterBuilder->setConditionType($type)
->setField($this->getName())
->setValue($value)
->create();
$this->getContext()->getDataProvider()->addFilter($filter);
}
}
If I comment this "if" statement it works right. How can I fix this in my module? How can I override Range class for my column?