Suggestion for "richselect" & "combo"

When retrieving data using the URL, the ‘richselect’/‘combo’ components expect the fields: ‘id’ and ‘value’. But if the ‘options’ configuration is used the fields ‘value’ & ‘label’ need to be defined.

This was causing some confusion since sometimes the ‘combo’/‘richselect’ components are configured with prefetched data and uses the ‘options’ configuration and some retrieve the data using a URL. It causes the server to have to format the data in two different methods depending on use. It would be very helpful if there was a way to not have to format the data two different ways.

A minor change to the routine ‘options_setter’ in ‘richselect’ component would allow the same object structure to be used in both situations and would most likely not cause side effects in previous code. At line 6410 the code is currently:

var id = (value[i].value||value[i].label||value[i]);

Could be changed to:

var id = (value[i].id||value[i].value||value[i].label||value[i]);

Then both URL retrieved data and prefetched data could use the ‘id’ & ‘value’ definition.
Plus it is still compatible with the current definitions.

Thanks,
Kris

Hi Kris,

thank you for the suggestion. The next version will support both ways of options definition.