Reputation: 145
How to Enable Filter functionality in Security area Silverstripe Admin?
Please tell me solution.
here i want to add filter functionality like second screenshot
Upvotes: 0
Views: 146
Reputation: 744
Add this in your Company class:
static $searchable_fields = array(
'Title',
'State',
'Description',
);
Upvotes: 0
Reputation: 4626
Well, SecurityAdmin for some reason doesn't subclass ModelAdmin but LeftAndMain directly. Depending on what you want to do it may be easiest to make your own MemberAdmin as a subclass of ModelAdmin. This has a search form and takes Member's $searchable_fields array into account.
class MemberAdmin extends ModelAdmin {
private static $url_segment = 'members';
private static $managed_models = array(
'Member'
);
}
would be a simple start for that. You can make a DataExtension for Member and edit the searchable fields defining a method called updateSearchableFields()
or defining directly as the private static $searchable_fields
array.
Upvotes: 2