How to create a controller and submit data from one side of a mui transfer list #10974
-
I implemented a reusable transfer list using Material-UI. This component accepts two arrays: left (which content will be shown at the left list) and right (which content will be shown at the right list). However, I don't know how to submit an array of id's elements of the left list (The array type should be number). I know that I have to implement a Controller and I don't know where. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
I don't have time to create a codesandbox currently, but I have some thoughts on how to structure your controlled If you have to refer to the state of both the left and right columns in most of the The main idea is to read the Let me know if this helps 🙌 |
Beta Was this translation helpful? Give feedback.
-
The issue was resolved. |
Beta Was this translation helpful? Give feedback.
-
To facilitate data transfer from one side of a Material-UI (MUI) Transfer List, create a controller by defining the source and destination arrays for the list items. Implement a function to handle the data submission upon user interaction, updating the respective arrays. Leverage MUI's TransferList component to streamline the process, ensuring a smooth and intuitive user experience. Employ state management to dynamically reflect changes and maintain synchronization between the source and destination lists. This approach provides a structured and effective way to manage data flow within the Transfer List component. To know more, read here: https://purecode.ai/blogs/mui-checkbox/ |
Beta Was this translation helpful? Give feedback.
Did you check the example codesandbox I've linked? I've used the exact MUI example to show how to make it work with RHF.