-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Link SimpleFormIterator reOrder function to a data field. #6601
Comments
Tagging this as a feature request. However, you can create your own iterator |
Also we need documentation about |
This has been added in #7104 |
took a quick look at the source behind this and, having no experience with the codebase, I couldn't immediately see an easy way to hook this behavior up. Someone more experienced with the codebase would probably have a better idea of what to look for. In the meantime, i did notice that the ordering of elements within SimpleFormIterator seems to be initially determined by the order in which they are present in the JSON response from the server, so if you prefer to disable the reordering and enforce a particular order, and if you control the server where the data is coming from, then solutions like that may be a decent workaround. Alternatively (and this is the workaround i used), it is possible to apply sorting to the data in the dataProvider before it gets to your UI |
That would be a solution, but one that would be bespoke to every instance where you wanted to capture the order data explicitly (which you presumably do if you want the use of the reorder UI function). I've got many instances in my solution when capturing order of array items is required. My fix/fudge for this was to create a bespoke read-only 'indexLinked' input field which sets the form value to the value of the current index in the array. Happy to share code if it helps anyone else looking for a solution. |
This enhancement request hasn't gained enough interest to get a PR from the community. As we canot keep all feature requests open, I'm closing it. If you feel like working on this feature, we'd love a PR! And if you need this feature, you can hire the react-admin core team to develop it for you. |
The new feature for re-ordering the SimpleFormIterator is great UI, however as it has been implemented as default functionality it frustratingly doesnt tie together with my data implementations where I have specified data fields which define the order of items in an Array.
Ideally the feature should enable the user to specify an index field so the order data can be preserved.
Maybe something like this
The text was updated successfully, but these errors were encountered: