View more context

 

r3v3rb

I see getLocale etc etc but no way to garner a list of all available

r3v3rb

nm, just went the statis string way as an enum - not easy to maintain but hey ho!

jules

Does anyone know if it’s possible to partial match searchable fields for RelationEditor gridfields? ie. Given an object with a description field with “This unique thing is great”, I can search for “This unique thing” and get a result for my many_many relationship, but I get no results when searching for “unique”

hailwood

@jules If i'm not mistaken the GridFieldAddExistingAutocompleter uses the DataObjects searchable_fields config to select what to search from, By default it's a StartsWith filter but you can override that

  1. class MyDO extends DataObject {
  2.  
  3. protected static $searchable_fields = [
  4. 'Title',
  5. 'Description' => ['filter' => 'PartialMatchFilter']
  6. ];
  7.  
  8. }
hailwood

Interestingly looking through the code I think you could also do

  1. class MyDO extends DataObject {
  2.  
  3. protected static $searchable_fields = [
  4. 'Title',
  5. 'Description:PartialMatch'
  6. ];
  7.  
  8. }

But I'm not sure if all of the CMS would respect that.

jules

I was hoping I’d be able to do it on the ->setSearchFields( but it’s not looking like it will at this point. Will have to move things around a bit, but thats awesome, thanks!