rare-sapphire
rare-sapphire14mo ago

Nested rowKey in a table

My rowkey value is nested. the example below doesn't work because rowKey don't accept this format. any workaround? <Table dataSource={record} rowKey={["supplier", "id"]}></table>
3 Replies
kapa.ai
kapa.ai14mo ago
Hi @_nirock. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- You can use a function for the rowKey prop to access the nested value. Here's an example based on the information provided:
<Table dataSource={record} rowKey={(record) => record.supplier.id}></Table>
<Table dataSource={record} rowKey={(record) => record.supplier.id}></Table>
This will set the rowKey to the nested id value inside the supplier object for each record. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai14mo ago
<@335790220425297921> kapa.ai is still learning and improving, please let us how it did by reacting below
rare-sapphire
rare-sapphire14mo ago
Thank you kapa. it worked..