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.

Data Model Questions

$searchable_fields with a default value


Reply

2 Posts   414 Views

Avatar
sajok

18 May 2013 at 1:19am (Last edited: 18 May 2013 1:20am), Community Member, 82 Posts

Hello,

I have ModelAdmin to manage "Manager" dataobject records. I have a list of $searchable_fields to filter my data object result. One of the search filters is a Status dropdown menu with "active' and "Inactive" values. By default it shows all dataobjects. What I want to see by default is only records that have active status. So far I have this code:

static $searchable_fields = array(
'FirstName' =>array( 'title' => 'First Name' ),
'Surname' =>array( 'title' => 'Surname' ),
'Status' =>array( 'title' => 'Status' )
);

any help?

Avatar
dacar

7 June 2013 at 12:04am Community Member, 168 Posts

hi, i am also looking for a way to filter the searchresults by default. I am using the subsites module and i want to list the news of the current subsite.

Hope that someone can help, Carsten.