Collects the configuration of the igxFilter directive and pipe.

Example

public get filterOptions() {
    const options = new IgxFilterOptions();
    options.key = 'text';
    options.inputValue = this.searchValue;
    return options;
}
new IgxFilterOptions(): IgxFilterOptions

Returns IgxFilterOptions

Input text value that will be used as a filtering pattern (matching condition is based on it). null and undefined are treated as an empty string, which matches all items by default.

inputValue: string | null | undefined = ''

Defined in projects/igniteui-angular/directives/src/directives/filter/filter.directive.ts:30

Represents the items of the list. It should be used to handle declaratively defined widgets. When set, these items are filtered instead of the ones passed to the pipe.

items: any[]

Defined in projects/igniteui-angular/directives/src/directives/filter/filter.directive.ts:42

Item property (or properties), which value should be used for filtering. When multiple keys are provided, an item matches when the value of any of them matches.

key: string | string[]

Defined in projects/igniteui-angular/directives/src/directives/filter/filter.directive.ts:36

Formats the original text before the matching process. By default returns the text in lower case.

formatter(valueToTest: string): string

Defined in projects/igniteui-angular/directives/src/directives/filter/filter.directive.ts:81

Parameters

  • valueToTest: string

    the text value returned by get_value

Returns string

Example

options.formatter = (valueToTest) => valueToTest.normalize('NFD').toLowerCase();

Gets the value to be tested from the item. By default returns the key-named property value of the item as a string if a key is provided and the value is not null or undefined (falsy values like 0 or false are returned as well). Otherwise returns the trimmed text content of the item's element, or an empty string if there is none.

get_value(item: any, key: string | undefined): string

Defined in projects/igniteui-angular/directives/src/directives/filter/filter.directive.ts:58

Parameters

  • item: any

    single item of the list to be filtered

  • key: string | undefined

    property name of the item, which value should be tested; undefined when no key is set

Returns string

Example

options.get_value = (item, key) => item.data[key];

Determines whether the item meets the condition. By default performs a case-insensitive "contains" match.

matchFn(valueToTest: string, inputValue: string): boolean

Defined in projects/igniteui-angular/directives/src/directives/filter/filter.directive.ts:98

Parameters

  • valueToTest: string

    text value that should be tested

  • inputValue: string

    text value from the input that the condition is based on; the filter pipe passes an empty string when inputValue is null or undefined

Returns boolean

Example

options.matchFn = (valueToTest, inputValue) => valueToTest.startsWith(inputValue.toLowerCase());

Executed after the matching test for every matched item. By default shows the item if it has a hidden property.

metConditionFn(item: any): void

Defined in projects/igniteui-angular/directives/src/directives/filter/filter.directive.ts:112

Parameters

  • item: any

    the matched item

Returns void

Example

options.metConditionFn = (item) => item.highlighted = true;

Executed after the matching test for every item that is NOT matched. By default hides the item if it has a hidden property.

overdueConditionFn(item: any): void

Defined in projects/igniteui-angular/directives/src/directives/filter/filter.directive.ts:128

Parameters

  • item: any

    the item that is not matched

Returns void

Example

options.overdueConditionFn = (item) => item.highlighted = false;