21286 Posts in 5733 Topics by 2602 members
General Questions
SilverStripe Forums » General Questions » Overwriting SearchForm in ModelAdmin_CollectionController
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 459 Views |
-
Overwriting SearchForm in ModelAdmin_CollectionController

27 May 2011 at 10:19pm
Hello,
I'm new to silverstripe and playing with ModelAdmin. I'm trying to overwrite SearchForm() in my EnquiryAdmin Class. Thing is Overwriting doesn't work for me.
class EnquiryAdmin_CollectionController extends ModelAdmin_CollectionController{
public function SearchForm() {
$form = parent::SearchForm();
var_dump($form);
die;
return $form;
} ...}
No dump, no die :S
What am I doing wrong?
Thanks in advance!
-
Re: Overwriting SearchForm in ModelAdmin_CollectionController

27 May 2011 at 11:21pm Last edited: 27 May 2011 11:31pm
Hi bueckl,
In ModelAdmin there is more than one search form, there is one search form per model and scaffolding is done from either the Summary_fields or the search_fields in the DataObject, to provide further customization to it you can (again within the DataObject) do this...
public function scaffoldSearchFields() {
$fields = parent::scaffoldSearchFields();
var_dump($fields);
return $fields;
} -
Re: Overwriting SearchForm in ModelAdmin_CollectionController

28 May 2011 at 12:17am
Hi swaiba,
Got it. Thanks for the hint!
| 459 Views | ||
|
Page:
1
|
Go to Top |


