protected function _applyToCollection($collection, $value = null) { if (($rangeAndLabels = $this->_getRangeAndLabels()) && $this->_isVisible($rangeAndLabels)) { extract($rangeAndLabels); /* @var $text array */ /* @var $from string */ /* @var $to string */ $isInside = false; $items = $this->_getItemsData(); $values = array(); foreach ($items as $item) { if ($item['value'] == $from) { if ($item['value'] != $to) { $isInside = true; } $values[] = $item['value']; } elseif ($item['value'] == $to) { if ($isInside) { $isInside = false; $values[] = $item['value']; } } elseif ($isInside) { $values[] = $item['value']; } } parent::_applyToCollection($collection, $values); } //$this->_getResource()->applyToCollection($collection, $this, $this->getMSelectedValues()); }