I am using Ant Design V2.X and I cannot update to a newer version. I inherited code and I am struggling to sort the data according to certain column. It should be ordered once, and not sorted dynamically.
This is what I have within the return()
function of my React component:
<Table size="small"
dataSource={this.props.Data}
rowKey={(record) => (record.LedgerId * 100 + record.PositionId).toString()}
pagination={false}
showHeader={true}
>
I was assuming the rowKey
would order my data according to the arrow-function, but this is not the case. Can you all guide me how to solve this?
Background info
Within the component, I have the following declaration:
export interface ViewTableProps {
selectedEntity: number,
Data Interfaces.ViewEntry[],
}
and elsewhere
export interface ViewEntry {
//Id: number,
LedgerId: number,
PositionId: number,
Value: number,
children: ViewEntry[]
}