简体   繁体   中英

How to access antd table current data state?

I have a table based on antd table component with custom filters like components-table-demo-filter-search

By default, I can only access to dataSource property which I provide but I can't find a way to get access to dataSource after filtering. How can I get access to filtered data?

You can get the filtered data source via the extra parameter of the onChange callback of the Table component.

The signature of onChange :

function(pagination, filters, sorter, extra: { currentDataSource: [], action: paginate | sort | filter })

When the custom filterSearch function executes, the onChange callback will be executed, and you will get the filtered data source by accessing extra.currentDataSource .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM