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   505 Views

Avatar
sajok

Community Member, 82 Posts

18 May 2013 at 1:19am

Edited: 18/05/2013 1:20am

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

Community Member, 168 Posts

7 June 2013 at 12:04am

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.