You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
igxFilter should be able to filter data source of widget as a pipe or to be set as a directive on a widget and to filter its items. It should be highly customizable and should support multiple user scenarios. E.g: filter by "contains", "starts with", "ends with" etc.
The igxFilter should not be coupled to any widget, just to operates with its items or datasource.
User Stories
Developer
As developer, I want:
igxFilter to support many scenarios of filtering: "contains", "starts with", "ends with" etc.
to manipulate the input and output data: such as input value, items, result
manage how the filter affect the matched and the dissociable items
to be able to cancel the filtering
End user
As a end user, I want to:
type into an input field and the widget should filter its items on every change
API
Options
You should be able to configure the igxFilter by passing an Options object to it. It should be able to override methods of Options object.
Also the default behaviors of method should be implemented. The defined options, set as filterOptions should override the default options of igxFilter.
Properties
inputValue - should set the input value (filter value).
Type: string
key - define a key for datasource.
Type: string
items - should represent items of widget for scenarios where filter is directive.
Type: Array of objects
Methods
get_value - should get value (from datasource or from items, depends on whether igxFilter is pipe or directive) that will be tested with the input value.
Type: Function Default behavior: if key is provided - should return value from datasource, otherwise should return item element text content.
formatter - should be able to manipulate the original text before matching process.
Type: Function Default behavior: should return text to lower case.
matchFn- should determine whether the item met the condition.
Type: Function Default behavior: "contains" should be implemented.
metConditionFn - should be able to manipulate every matched item after the matching test.
Type: Function Default behavior: the matched item should be shown
overdueConditionFn - should be able to manipulate every dissociable item after the matching test.
Type: Function Default behavior: dissociable item should be hidden
Events
filtering - it should be triggered before the filtering process.
It should be cancelable by the Boolean property cancel of the input object.
filtered - it should triggered after the filtering is done.
A pipe takes in data as input and transforms it to a desired output.
For the part where igxFilter should be set as a directive, some additional implementation will be needed.
Because the items of the widget will be rendered already, the DOM elements of items should be pass to the igxFilter instead of datasource. Use the options object and it property items to pass them.