We have used antd table with pagination + expandable row feature. Row gets expanded when clicked on + icon. Internally Row details api is called and displayed in expanded view.
We have used antd expanded row feature and also called api , It is working fine for first page. As we added pagination as well so when checked for second page it won't work, it still shows old key record.
onTableRowExpand(expanded, record){
getChildData(record.id) // service call to fetch child data displayed as expanded row details
var keys = [];
if(expanded){
keys.push(record.id); // record.id as row key which is coming same across pagination
}
this.setState({expandedRowKeys: keys});
}
We want to know changes required for showing expanded row ( child table ) using ReactJS+ Antd where pagination is also included.
expandedRowRenderfunction has the following signature:Function(record, index, indent, expanded):ReactNode. it seems you are usingrecordas expanded. Which version of antd are you using? - Yaelet