Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

ModelAdmin


Reply


17 Posts   4061 Views

Avatar
Fuzz10

Community Member, 787 Posts

25 November 2008 at 9:29pm

Hmm, odd.

Works for me ...

Although I have only used a very simple data-object class ....

Avatar
UncleCheese

Forum Moderator, 4096 Posts

26 November 2008 at 3:46am

Would you mind posting all of your relevant code?

Avatar
Fuzz10

Community Member, 787 Posts

26 November 2008 at 5:18am

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';
}

Avatar
UncleCheese

Forum Moderator, 4096 Posts

27 November 2008 at 4:19am

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?

Avatar
Fuzz10

Community Member, 787 Posts

27 November 2008 at 4:34am

;-)

Hhaa.. indeed , you need to download the latest trunk release (2.3)...

Avatar
Ingo

Forum Moderator, 801 Posts

29 November 2008 at 9:42pm

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)

Avatar
Apophenian

Community Member, 46 Posts

8 December 2008 at 3:32pm

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?

Avatar
Ingo

Forum Moderator, 801 Posts

8 December 2008 at 3:49pm

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.