http://jsfiddle.net/pyCTN/115/
If you view the above fiddle and click on a Sort Type link, you can choose between 'Score, Count and Average' and the array will be sorted accordingly.
However, I need to make two enhancements:
Instead of Sort Type, the dropdown link text below should show the selected sort type i.e. 'Score, Count or Average'.
<a class="btn dropdown-toggle" data-bind="text: 'Sort Type'" data-toggle="dropdown"></a>
Instead of showing 'Score', the table text should show the selected sort type value from the array
<span class="input-group-addon" data-bind="text: Score"></span>
I'm using a sort custom binding and I'm wondering if the best approach is to amend that and return an observable containing the sort type and an observable array containing only the array item name and selected sort type.
Another consideration is that sort type 'Score' should be returned by default. Currently, there is no default.
Any guidance would be much appreciated.