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
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:
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:
----------------------<@335790220425297921> kapa.ai is still learning and improving, please let us how it did by reacting below
rival-black•17mo ago
Thank you kapa. it worked..