Can I sort content in DIVs?

Is it possible to sort DIVs based on valuethe form in which the DIV is contained?

Hare is HTML to better get a visual idea of ​​what HTML looks like.

http://jsfiddle.net/littlesandra88/gtYBE/1/

Here is the HTML simplified to illustrate the problem:

<div id="contentEdit">
  <div class="row">
    <div class="cellHeader"> ID    </div>
    <div class="cellHeader"> Title </div>
  </div>

  <div id="content">

    <div id="127">
      <form action="" method="post">
    <div class="row">
          <!-- ----- cell one -----              -------------------------- cell two ----------------------- -->
      <div class="cell"> 127 </div>   <div class="cell"> <input name="title" value="dfg" type="text" /> </div>
    </div>
      </form>
    </div>

    <!-- next row -->

    <div id="27">
      <form action="" method="post">
    <div class="row">
      <div class="cell"> 27 </div>   <div class="cell"> <input name="title" value="afg" type="text" /> </div>
    </div>
      </form>
    </div>

  </div>
</div>

I would like to press a button to sort each row, i.e. <div id="127">and <div id="27">, based on the content <div class="cell"> 127 </div>(content here 127).

Another button is to sort the rows based on the form value.

Is it possible?

+3
source share
2 answers

Here is an example of sorting by id: http://jsfiddle.net/ryanrolds/CuJ9T/

jQuery. , , .

+1

JQuery. javascript, libararies , .

http://tablesorter.com/docs/

0

All Articles