useTable. Passing Id to data provider?
Hello,
My requirements need that my application renders a table("parent" table), and each table row will be expandable into a nested table("child" table for each "parent" table row ). I'm using Refine and Antd for this. I have built the layout and populated the tables with some dummy data, but now i need to replace with real data from a backend API.
As per Refine documentation suggestion, I use "useTable" to call a "getList" method from a data provider (I customized the data provider, because i need the "getList" to be a post request, and to pass "id" as a body). This works because i have hardcoded an "id"
My issue is that, I now need to pass the real "id" from my React component to the data provider, but there seems to be no way to do it using "useTable" hook. I could try to use a different hook, but I believe this is the only way to render tables, using {...tableProps} ?
Can someone give me any guidance? I can provide more details if needed. I've been trying for quite sometime now and no luck
thanks
5 Replies
Hi @jaco0670. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Hmm, I don't know enough to give you a confident answer yet. However, you can refer to the refine documentation (https://refine.dev/docs) and refine blog (https://refine.dev/blog) for more information and examples on how to use refine with Ant Design and data providers.
----------------------
Note: you can ask me a follow up question by @ mentioning me again
:speech_balloon:
----------------------Overview | refine
What is refine?
Blog | refine
A Docusaurus powered blog!
<@486442088280358912> kapa.ai is still learning and improving, please let us how it did by reacting below
eastern-cyan•2y ago
use can use meta for pass additional information to data provider
https://refine.dev/docs/api-reference/antd/hooks/table/useTable/#meta
wise-whiteOP•2y ago
@alicanerdurmaz thanks so much, I missed that bit in the docs, I can proceed now