How to reorder gridview rows using jQuery?

I use Drag and Drop to sort the grid lines,

In this process, I want the order (sequence) of the dragged row to change dynamically, as if I was dragging the 3rd row to 1st place, I want it (order) to change to 1 dynamically.

I do not understand how to cyclically and dynamically change the order.

var SortedIDs = ""; $(".gvSortPorts").find("tbody > tr").each(function () { SortedIDs += $(this).attr("id") + "1"; }); 

Can someone help in providing an idea, I want this to be useful with jquery.

+4
source share
2 answers

The number of jquery plugins available for sorting is:

I have a datatable that provide you with a way that will help you a lot. you can customize as you wish and provide a number of functions such as pagination, search, sorting, etc.

Hope this solves your problem.

0
source

Add the following links to javascript jQuery and Tablesorter files inside the section of the main page.

 <script src="scripts/jquery-1.4.3.min.js" type="text/javascript"></script> <script src="scripts/jquery.tablesorter.min.js" type="text/javascript"></script> 

Finally, call the tablesorter function in gridview to do a gridview sort.

 <script type="text/javascript"> $(document).ready(function() { $("#GridView1").tablesorter(); }); </script> 

Reference:

http://www.ezzylearning.com/tutorial.aspx?tid=2168345

For Drag And Drop:

http://forums.asp.net/t/1615668.aspx/1

Hope this will be helpful.

+2
source

All Articles