Update Table items asynchronously

Hello! I am experimenting with refine and I have a couple locations where I populate a table by: 1) Making a get list call 2) Iterating through the list items and making multiple get one calls (to get more information about each item) Ideally, I would like to update the table every time one of the async calls from [2] returns. How can I set this up using a custom data provider? Thank you!
O
Omer540d ago
Hey @misstsuliu 👋, Welcome, we are glad to see you! Which UI framework are you using?
O
optimistic-gold540d ago
Currently experimenting with antD
O
Omer540d ago
You can create a custom component for calling useOne on expendedRowRenderer. https://github.com/refinedev/refine/blob/master/examples/table/antd/advancedTable/src/pages/posts/list.tsx#L142 You can find an one of example here https://refine.dev/docs/examples/table/antd/advancedTable/
Advanced Table | refine
Multiple record deletion, modification, and other features can be used simultaneously in a table. It's an example of a Advanced Table made with refine's customization feature.
GitHub
refine/list.tsx at master · refinedev/refine
Build your React-based CRUD applications, without constraints. - refine/list.tsx at master · refinedev/refine
O
optimistic-gold539d ago
I will try this out! Thanks so much 🙂 So reading through, this is fairly close to what I want... However, I would like the information shown in the table columns directly rather than under the expanded view for each row. Is there any way to do that? Additionally, for future ref, is there a way to do this using material UI too?
O
Omer539d ago
I will create an example for you ⚡️
O
Omer539d ago
O
optimistic-gold539d ago
This makes sense, thanks!! If there are two or more columns that require information from that separate API call, will there be an optimization to only make 1 call?
O
optimistic-gold539d ago
Hello! I wanted to provide an update that using the "render" prop within the Table.Column ended up working out! Even if I had several columns that used the same getOne call, it seems the redundant calls are aggregated 🙂
O
Omer539d ago
That's great, actually the way to avoid this is to use useMany 🎯
O
optimistic-gold539d ago
I am assuming you mean providing ids in query? Unfortunately our API doesn't currently support a query parameter with a list of all ids, so the GET call needs to be looped over every id.
O
Omer539d ago
Ah I got it 🙂
More Posts
refine reporting toolHi, Are there any packages for generating dynamic reports? I can't find a free package and I'm not Help with task managerI am planning to build a task manager for our company i started following example give in blog > HoToast notification recommendation?Hey Guys, would anyone like to recommend their favorite toast notification to use with Refine?Webpack returning errors from the libHello, I updated refine packages to the latest version, and now is printing errors related to the liMigrate from version 2 to 3.I've run the command `npx pankodrefine-codemod refine2-to-refine3` but I'm receiving the following eError - DockerHello, after deploying in docker, it is returning this error when accessing the login page. Do you How to select RangePickerHello, I need to use TimePicker.RangePicker that Ant Design provides and I can see that there is a Display list of data from API response that has a different format.I am trying to display a list of data from API response with a response value as below: ``` { counHow to implement jwt authentication in authProvider?I have followed this link https://refine.dev/docs/api-reference/core/providers/auth-provider/#settinCustom Graphql query inputsHello, Can someone please explain to me how to write custom Graphql queries? We are using the PothAuzure AD B2C for Authentication and AuthorizationHi All, I am trying to set up auth with Azure AD. After a successful login on Azure AD B2C, I am redqueryOptionsI want to hit an Api with a specific route, for exampe, lets say api/user-directories/ for example Add smooth scroll effect in iconsHey everyone I want to made some changes in footer section of the this website but I'm not able to fHide *Button for forbidden actionsHi! Is there a way to avoid the disabled button for actions an user cannot do (because unauthorized)difference between importing from refinecore and refineantdfor example i have a component useSelect so if i import it from refinecore it dont have same props cI am getting 301 status using refine-simple-rest although there is not any error on postman.I am using refine-simple-rest as my data provider to connect with the django rest API but I get backchange label of breadcrumbi am using breadcrumb in create page but i am getting its as patients/create i want to change labeluseSelect onSearch without call API cos i got limit call APIcan i call API once and search query without recall API?How to submit a modal form to create a Comment when you are in the Post show page?Given the fact that I'm a first timer using React, Building refine app has been amazing. What I'd liMaking duplicate calls in the apiUsing the github example (finefoods - mui), the application is making duplicate calls in the api Do