Skip to content

Table column onFilter doesn not impact shown data #6592

@OlkaB

Description

@OlkaB
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.2.20

Environment

Windows 10 Pro v. 22H2, Chrome v. 113.0.5672.127, Vue (see one used on official docs) [I'm also testing with Vue 3.3.2 with AntDesignVue v. 3.2.20 and it's also not working)

Reproduction link

https://antdv.com/components/table#components-table-demo-nested-table

Steps to reproduce

Go to official docs [https://antdv.com/components/table#components-table-demo-head] and try to use filter on 'Name' column. (Un)selecting items from filter menu doesn't impact the shown data in the table.
It's also not logging anything when I'm trying it in the local repo with console log:

const columns = [
{
title: 'Gender',
dataIndex: 'gender',
filters: [
{ text: 'Male', value: 'male' },
{ text: 'Female', value: 'female' },
],
onFilter: (value, record) => {
console.log('onFilter: ', {
value, record
}); // nothing going on here
return (new RegExp(value, 'i')).test(record.gender)
},
},

What is expected?

onFilter method should be called and filter table data - leaving visible only those that returns truthy value from onFilter method

What is actually happening?

Nothing - there is no visible impact.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions