Hmm, odd.
Works for me ...
Although I have only used a very simple data-object class ....
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Hmm, odd.
Works for me ...
Although I have only used a very simple data-object class ....
Would you mind posting all of your relevant code?
Sure, no problem... ;-)
Data-class :
class Bestelling extends DataObject {
static $db = array(
'BestelNummerID' => 'Int',
'BestellingText' => 'HTMLText'
);
static $searchable_fields = array(
'BestellingText' => 'PartialMatchFilter'
);
And the modeladmin class
class AdminBestelling extends ModelAdmin
{
protected static $managed_models = array (
'Bestelling'
);
static $url_segment = 'beheer';
static $menu_title = 'Bestellingen';
}
I suddenly feel really stupid. This isn't bundled with the 2.2.3 release, is it? I can't find a ModelAdmin class anywhere in my filesystem. Is it something I can only get from the trunk?
;-)
Hhaa.. indeed , you need to download the latest trunk release (2.3)...
Good to see some interest in ModelAdmin, we found it to be a quite handy tool for quick data entry, prototyping as well as fully fledged admin interfaces. You're right, there's very little documentation on it, I'll try to extend http://doc.silverstripe.com/doku.php?id=modeladmin before the final 2.3 release (see http://open.silverstripe.com/ticket/3172)
Sorry to hijack this thread, but does the $searchable_fields array impact the front end search in any way, or is it just restricted to the admin area?
The SearchForm class currently doesn't use DataObject::$searchable_fields, thats still on the list - but there's nothing keeping you from implementing your own SearchContext in the frontend generally.