filterFieldsByComparator()
filterFieldsByComparator(
field
:FullField
<Option
,Option
>,fields
:OptionList
<FullField
<Option
,Option
>>,operator
:string
):FullField
<Option
,Option
>[] | {label
:string
;options
:WithUnknownIndex
<FullField
<Option
,Option
>>[]; }[]
Defined in: packages/react-querybuilder/src/utils/filterFieldsByComparator.ts:25
For a given FullField, returns the fields
list filtered for
other fields that match by comparator
. Only fields other than the
one in question will ever be included, even if comparator
is null
or undefined
. If comparator
is a string, fields with the same value
for that property will be included. If comparator
is a function, each
field will be passed to the function along with the operator
and fields
for which the function returns true
will be included.
Parameters
Parameter | Type | Description |
---|---|---|
field | FullField <Option , Option > | The field in question. |
fields | OptionList <FullField <Option , Option >> | The full FullField list to be filtered. |
operator | string | - |
Returns
FullField
<Option
, Option
>[] | { label
: string
; options
: WithUnknownIndex
<FullField
<Option
, Option
>>[]; }[]
API documentation is generated from the latest commit on the main
branch. It may be somewhat inconsistent with official releases of React Query Builder.