Closed
Description
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.
populateFormDefinition : function(formDefinition, enums){
_.forEach(formDefinition,function(formElementMeta,columnIndex){
_.forEach(formDefinition[columnIndex],function(formElementMeta,rowIndex){
if(typeof(enums[formElementMeta.key]) !== 'undefined' ){
formDefinition[columnIndex][rowIndex].titleMap = enums[formElementMeta.key];
}
});
});
},
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?