-
Notifications
You must be signed in to change notification settings - Fork 652
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
Dropdown ordering #334
Comments
Do you use the object or the array form of the |
object. e.g. enums[formElementMeta.key] could be: Object |
Ok, it should be in the object order, but since object order is not guaranteed in javascript I'll recommend you use the array syntax for the titleMap (the object syntax is there for JSON Form compatability). I wonder if this popped up when we changed from a |
Ahh nice! I thought it would have to be an array of strings, but I've just looked at docs and its an array of objects, I will try this out in the morning, thanks a lot! I must say I love this project - the documentation is great and the team is so quick to resond, thank you! I'll leave this open for now, and providing it works I'll close it in morning. |
Okay so if anyone else has this - you should use array of objects containing single value/name pair, rather than just object containing many mappings. (See my above object I used). To convert this object into a sorted array of objects I did this:
Thanks David for pointing this out. |
Is it possible to have the dropdowns sorted in alphabetical order?
I have some enumeration mapping 'object' which I have. I loop through this and if it has an enum which matches a field i have, then it assigns the enum mapping to the formDefinition fields titleMap.
If you debug and inspect the titleMap, it's in order, e.g.
'a' : 'a'
'b' : 'b' ....
However, when it is rendered onthe screen, it seems to be in a random order?
Is this a bug or am I doing something wrong, can anyone advise please?
Thanks.
Also while I'm here - is there a way to have an empty dropdown value - so that you can 'unselect' a value.....I could simply add a blank mapping to the titlemap, i.e. '':'' but is there a more elegent solution?
The text was updated successfully, but these errors were encountered: