P粉7859057972023-08-28 10:42:03
This is another library.
The changes that need to be made are -
Add sorting js
Add the class name sortable
to the table.
Click on the table title to sort the table accordingly:
<script src="https://www.kryogenix.org/code/browser/sorttable/sorttable.js"></script> <table class="sortable"> <tr> <th>Name</th> <th>Address</th> <th>Sales Person</th> </tr> <tr class="item"> <td>user:0001</td> <td>UK</td> <td>Melissa</td> </tr> <tr class="item"> <td>user:0002</td> <td>France</td> <td>Justin</td> </tr> <tr class="item"> <td>user:0003</td> <td>San Francisco</td> <td>Judy</td> </tr> <tr class="item"> <td>user:0004</td> <td>Canada</td> <td>Skipper</td> </tr> <tr class="item"> <td>user:0005</td> <td>Christchurch</td> <td>Alex</td> </tr> </table>
P粉6429205222023-08-28 00:27:23
Check if you can use any of the JQuery plugins mentioned below. Simply fantastic, offers a wide range of working options and is less effort to integrate. :)
https://github.com/paulopmx/Flexigrid - Flexgrid
http://datatables.net/index - Data table.
https://github.com/tonytomov/jqGrid
If not, you need to have a link to the headers that call the server-side script to invoke the sort.