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.

We've moved the forum!

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.

Archive /

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

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

ModelAdmin Scaffolding feature


Go to End


1818 Views

Avatar
Dig

Community Member, 33 Posts

9 September 2008 at 11:30am

Edited: 09/09/2008 11:32am

First of all this is a great feature and its saved me a lot of time now I've finally got the hang of most of it. There is one problem I've encountered, as the $searchable_fields are defined in a static array I can't pass contructor parameters to fields like dropdowns etc. I'd like dropdown options in the search for filtering on has_one data.

I made my own class that just hardcoded the arguments I needed but its not that successful and seems to go against the simplicity of the scaffolding system.

In other areas like getCMSFields I can use TypeDropdown to so this, but it requires parameters in order to work (obviously).

Is there any current elegant solution to using dropdowns in the searches?

Cheers,
Nick

Edit: While I'm at it is there a simple way to choose which columns are initially checked for search results, one of my DataObjects is also a page type and has loads of extraneous information I'd rather not bother showing :)

Cheers again
Nick