I have a select field with a list of fees, every fee has an id, description and status- New or Old.
<select id="feesSelect" data-bind="options: $root.fees(), optionsText: 'description', optionsValue: 'feesID', value: feeID(), optionsCaption: 'Choose Fee'"></select>
The list is ordered by status.
How can I add titles to the option
elements within the list, according to the status- one title: new
and one: old
.
I need my list to look like that:
NEW --title
test1 --option (fee description)
test2 -option (fee description)
OLD --title
test3 --option (fee description)
test4 --option (fee description)
I tried that- but it's not working:
<select id="feesSelect" data-bind="foreach: $root.fees(), value: feeID()>
<option data-bind="value: feesID, text: description, attr: {title: status}"></option>
</select>