So I was able to try some other things - Essentially I have the following now -
DataExtension for model admin class- update search context
class FormRequestAdminExtension extends DataExtension{
public function updateSearchContext($context)
{
$context->getFields()->push(DateField::create('Created:GreaterThanOrEqual','Start'));
$context->getFields()->push(DateField::create('Created:LessThanOrEqual','End'));
return $context;
}
}
Model Admin getList
public function getList()
{
$list = parent::getList();
$params = $this->getRequest()->requestVar('filter');
$filters = $params[$this->sanitiseClassName($this->modelClass)];
if($filters){
return $list->filter($filters);
}
return $list;
}
This filters the data fine now as I would like. The only thing is the export button now doesn’t respect this search context. Anyone know how to get an export of just your search results in model admin?