mergeFilterFieldMapping
Overview
Register custom filter types, or adjust existing ones, for filter forms. Each entry's components merge into filterFieldMapping; its initialValue, array, range, and repeatedKey keys merge into the value table (FilterFieldMappings). A filter type needs both to be offered in a list's filter menu: the value table tells the form what an empty or URL-restored value looks like, and the component table tells it what to render.
Signature
mergeFilterFieldMapping(customMappings)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| customMappings | object | yes | Registrations keyed by filter type. |
Returns
The updated filter field mappings.
Examples
js
mergeFilterFieldMapping({
MyCustomField: { component: MyCustomField, widget: MyCustomWidget, initialValue: null },
});Source
client/lib/utils/fieldMappings.js:938