Jump to:

3373 Posts in 998 Topics by 712 members

Data Model Questions

SilverStripe Forums » Data Model Questions » $searchable_fields with a default value

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 311 Views
  • sajok
    Avatar
    Community Member
    82 Posts

    $searchable_fields with a default value Link to this post

    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?

  • dacar
    Avatar
    Community Member
    168 Posts

    Re: $searchable_fields with a default value Link to this post

    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.

    311 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.