Skip to content

SelectFilter onFilter hook is not fired when filter value is reset #1221

Closed
@Popov85

Description

@Popov85

onFilter hook perfectly works when a value in select filter is selected and returns proper value, but when I reset it manually - this event is not fired!

The reason why I need it to get fired is that I wanna implement a feature when one column filter depends on another in such the way when I select a filter value in one column, the list of values in the next column filter shortens.

Without being able to detect the filter reset event - I cannot return the original list of the linked column.
Probably for this functionality there is another solution, please suggest!

Also, I noticed that if I have multiple columns and onFilter hook is set only in one column, the event is fired all the time another column's filter changes without any changes to the target column filter!
I feels like a wrong behavior.
Issue04012020

On the picture, I consecutively set 3 filters from the left to the right in different columns and the hook onFilter of Organisation's column is fired 3 times!
Here is code snippet:

   {
            dataField: 'faculty.organisation.orgId',
            text: 'Organisation',
            sort: true,
            filter: selectFilter({
                options: organisations,
                onFilter: filterVal => console.log(`Filter value: ${filterVal}`),
            }),
            formatter: cell => organisations[cell]
        },

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions