Skip to content

Commit

Permalink
Readme updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
mfendeksilverstripe committed Apr 12, 2018
1 parent fda6fe8 commit f729b10
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ $gridFieldConfig->addComponent($filter, GridFieldPaginator::class);

### Example #3

* filter with `TextField` and custom filter method
* filter with `TextField` (with custom placeholder text) and custom filter method

Our custom filter method filters records by three different `DB` columns via `PartialMatch` filter.

Expand All @@ -227,7 +227,10 @@ $gridFieldConfig->removeComponentsByType(GridFieldFilterHeader::class);
$filter = new RichFilterHeader();
$filter
->setFilterConfig([
'Label',
'Label',
])
->setFilterFields([
'Label' => $label = TextField::create('', ''),
])
->setFilterMethods([
'Label' => function (DataList $list, $name, $value) {
Expand All @@ -238,6 +241,7 @@ $filter
]);
},
]);
$label->setAttribute('placeholder', 'Filter by three different columns');
$gridFieldConfig->addComponent($filter, GridFieldPaginator::class);
```

0 comments on commit f729b10

Please sign in to comment.