Currently the automatic scaffolding for search fields where there is an enum produces a drop down only allowing one selection to be made. I'm interested in using existing filters to change this to allow multiple selections.
Given the following dataobject...
class MyDataObject extends DataObject {
static $db = array(
'Name' => "Varchar(255)",
'MyEnum' => "Enum('Option1,Option2,Option3','Option1')"
);
}
...and the following ModelAdmin...
class MyModelAdmin extends ModelAdmin {
static $mangaged_models = array(
'MyDataObject',
);
static $url_segment = 'mymodeladmin';
static $menu_title = 'MyModelAdmin';
static $menu_priority = 9;
}
...I'm looking for a module or a simple Filter of some kind to scaffold the Enum into a multiple select listbox
the multiple select listbox is defined as...
- Allows multiple selection
- After typing some characters suggestions are offered
And I'm asking for a generic solution - I can build a search context for each model admin but this is very frustrating. Something like the following using either an existing filter (ExactMatchMultiFilter looks perfect but doesn't seem to actually work) or if there is one in a module or someone can suggest how to modify an existing filter for this that would be great.
class MyDataObject extends DataObject {
static $db = array(
'Name' => "Varchar(255)",
'MyEnum' => "Enum('Option1,Option2,Option3','Option1')"
);
public static $searchable_fields = array (
'MyEnum' => array('filter' => 'ExactMatchMultiFilter')
);
}
Any help is much appreciated.