verbal-limeV
Refine3y ago
5 replies
verbal-lime

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
Was this page helpful?