Hi,
How would I do the above, I have a text field which is an amalgamation of several other fields.
I want to be able to search the TextField with my custom search context with a dropdown.
I have a feeling it's something to do with scaffolding.. but not quite sure.
public function getCustomSearchContext() {
$fields = $this->scaffoldSearchFields(array(
'restrictFields' => array('Type', 'Regions', 'Budget')
));
$filters = array(
'Type' => new ExactMatchFilter('Type'),
'Budget' => new ExactMatchFilter('Budget'),
'Regions' => new PartialMatchFilter('Regions')
);
return new SearchContext(
$this->class,
$fields,
$filters
);
}
Regions is defined as a Textfield in the DB, and so it appears as a input textbox on the frontend, but I would like to use a select with specified options, as it is consists of a number of fields which are set with dropdowns.
Is there anything I can do to $fields or something to change the type? I want to change the Textfield into a DropdownField in the front end.
Cheers, would appreciate any help!