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;
} Constructors
Section titled "Constructors"IgxFilterOptions
Section titled "IgxFilterOptions"new IgxFilterOptions(): IgxFilterOptions Returns IgxFilterOptions
Properties
Section titled "Properties"inputValue
Section titled "inputValue"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
items
Section titled "items"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
Methods
Section titled "Methods"formatter
Section titled "formatter"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:
stringthe text value returned by
get_value
Returns string
Example
options.formatter = (valueToTest) => valueToTest.normalize('NFD').toLowerCase(); get_value
Section titled "get_value"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:
anysingle item of the list to be filtered
- key:
string | undefinedproperty name of the item, which value should be tested;
undefinedwhen nokeyis set
Returns string
Example
options.get_value = (item, key) => item.data[key]; matchFn
Section titled "matchFn"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:
stringtext value that should be tested
- inputValue:
stringtext value from the input that the condition is based on; the filter pipe passes an empty string when
inputValueisnullorundefined
Returns boolean
Example
options.matchFn = (valueToTest, inputValue) => valueToTest.startsWith(inputValue.toLowerCase()); metConditionFn
Section titled "metConditionFn"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:
anythe matched item
Returns void
Example
options.metConditionFn = (item) => item.highlighted = true; overdueConditionFn
Section titled "overdueConditionFn"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:
anythe item that is not matched
Returns void
Example
options.overdueConditionFn = (item) => item.highlighted = false;