select props

How to use select props to get 2 datas from same resource
5 Replies
kapa.ai
kapa.ai3mo ago
Hi @Sly. 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, for detailed guidance on using select props with refine, you might find the documentation on hooks like useSelect very useful. These hooks are designed to work seamlessly with UI libraries such as Ant Design and Mantine, allowing you to fetch and display data from your resources effectively. You can explore more about these hooks and their usage in the refine documentation: - For Ant Design: useSelect with Ant Design (https://refine.dev/docs/ui-integrations/ant-design/hooks/use-select/) - For Mantine: useSelect with Mantine (https://refine.dev/docs/ui-integrations/mantine/hooks/use-select/) These sections provide examples and explanations on how to utilize select props within refine applications, which might offer insights into handling multiple data from the same resource. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3mo ago
<@1172098337760096258> kapa.ai is still learning and improving, please let us know how it did by reacting below
adverse-sapphire
adverse-sapphire3mo ago
@kapa.ai How to use onfinish to add 2 values from another resource
kapa.ai
kapa.ai3mo ago
Let me check the knowledge base for you. One moment! :books: ---------------------- Based on the extracts provided, there isn't specific information on using onFinish to add two values from another resource directly. However, the onFinish function is mentioned across different contexts (Mantine, Ant Design, React Hook Form) within refine, indicating its flexibility and utility in handling form submissions and potentially manipulating data before sending it to an API. To achieve the goal of adding two values from another resource using onFinish, you would typically fetch the necessary data from the other resource, perform your logic (such as adding the values), and then use the onFinish function to submit the modified payload. While the extracts don't provide a direct example of this process, they do outline the general capability of onFinish to modify payloads before submission. Here's a conceptual approach based on the information about onFinish: 1. Fetch the data from the other resource you need to work with. This might involve using hooks like useQuery or similar to retrieve the data within your component. 2. In your form's onFinish function, incorporate the logic to add or otherwise manipulate the values from the fetched data. 3. Use the modified data as part of the payload you submit in the onFinish function. Since the extracts don't include specific code examples for this scenario, I recommend consulting the refine documentation for more detailed examples on using onFinish and fetching data from resources. The documentation on hooks like useForm and useQuery might be particularly helpful: - useForm Hook Documentation (https://refine.dev/docs/core/hooks/form/useForm/) - Fetching Data Documentation (https://refine.dev/docs/core/hooks/data/useQuery/) These sections can provide further insights into how to effectively use refine's hooks to manipulate and submit data in your applications. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai3mo ago
<@1172098337760096258> kapa.ai is still learning and improving, please let us know how it did by reacting below