gpt4 book ai didi

reactjs - ant design 中对 dataSource 执行过滤函数后,获取组件表中过滤后的数据

转载 作者:行者123 更新时间:2023-12-03 13:47:29 25 4
gpt4 key购买 nike

在使用 Ant-desigin 中的 Table 组件时,我想在对 dataSource 执行过滤函数后获取 table 中过滤后的数据,但找不到获取方法。有一个函数叫onChange,它只能获取过滤条件,不能获取过滤后的数据。

最佳答案

您可以轻松添加onChange <Table/> 内的属性。创建一个具有 4 个参数的函数:pagination, filters, sorter, extra您要查找的数据是 extra.currentDataSource .

onChange={
(pagination, filters, sorter, extra) => {
console.log(extra.currentDataSource)
}
}

关于reactjs - ant design 中对 dataSource 执行过滤函数后,获取组件表中过滤后的数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50074789/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com