Editor: Ordering Select option on Value NOT text
Editor: Ordering Select option on Value NOT text
Hi
I have a form for entering Injury Severity in a H&S form.
The "Table" has 2 fields value and label:
(value) (label)
1 Slight
2 Moderate
3 Significant
4 Intolerable
When I use these in the Editor using:
Field::inst( 'tblHealthAndSafetyRiskAssessmentHazards.likelihood' )
->options(Options::inst()
->table( 'tblHandSRALikelihoodLabels')
->value( 'value' )
->label( 'Label' )
)
->validator( 'Validate::dbValues' )
I get the list as
Intolerable
Moderate
Significant
Slight
/
This is obviously incorrect - is there a way of ordering the list by "value"?
I know I could change the labels to:
- Slight
- Moderate
- Significant
- Intolerable
But that's just pants
Thank you very much for any advice given.
This question has an accepted answers - jump to answer
Answers
Forget it - PICNIC Error!!
Problem In Chair Not In Computer - 10 seconds after posting I had a brain wave and it worked - just use the option ORDER!:
Silly me !
Brilliant! I haven't seen that acronym before. Love it.
Nice one finding the solution as well . Looks perfect to me (and it is designed that way, that's not a fluke that it works).
Allan