title: knockout - Bring checked checkboxes on top of the list using foreach
body: <pre><code>&lt;div data-bind=&quot;foreach: lists&quot;&gt;
      &lt;div class=&quot;checkbox list-item&quot;&gt;
          &lt;label&gt;
              &lt;input type=&quot;checkbox&quot; data-bind=&quot;checked: isSelected, click: $parent.list, disable: $parent.disableInput()&quot;/&gt; &lt;span data-bind=&quot;text: note&quot;&gt;
          &lt;/label&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  <p>I tried to do the checked checkboxes to move on top. When I click the unchecked checkbox, it needs to move on top. When I click the checked checkbox, it needs to move back down.</p>