title: Loop and Reorder Observable Array
body: <p>I am using the following functions to sort an observableArray based on an integer value called sort:</p>
  
  <pre><code>model.sortColumns = function (a, b) {
    return a.Order &gt; b.Order ? 1 : -1;
  };
  
  model.sortedColumns = ko.dependentObservable(function () {
    return this.reportFields.slice().sort(this.sortColumns);
  }, model);
  </code></pre>
  
  <p>I am using a foreach to display them on screen and all works well, what I need to do now though is provide the ability in the foreach to change the order.  I was going to put simple up/down arrow icons with click events, but I'm not sure how to go about changing it, has anyone done anything like this before?</p>