Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to drag and drop table row in ASP.Net MVC3 using jquery without using any plugin?
    primarykey
    data
    text
    <p>I am using datatable plugin in my ASP.Net MVC3 project. Here I have to implement the row reordering. I used "jQuery.dataTables.rowReordering.js" plugin to implement it. For ui its working fine, but It failed to call server side function. </p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function () { $('#myDataTable').dataTable().rowReordering({sURL: "/AdminArea/UpdateOrder" }); }); &lt;/script&gt; </code></pre> <p>my controller code is</p> <pre><code>public ActionResult Index() { return View(db.AdminAreas.ToList()); } public void UpdateOrder(int id, int fromPosition, int toPosition, string direction) { } </code></pre> <p>View</p> <pre><code>&lt;table id="myDataTable"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt; OrderNo &lt;/th&gt; &lt;th&gt; SubArea &lt;/th&gt; &lt;th&gt; Description &lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; @{ if (@ViewData["SubAreaForArea"] != null) { IEnumerable&lt;GridDragAndDrop.Models.SubAreaForAdmin&gt; subarea = ViewData["SubAreaForArea"] as IEnumerable&lt;GridDragAndDrop.Models.SubAreaForAdmin&gt;; foreach (var item in subarea) { &lt;tr class="order"&gt; &lt;td&gt; @Html.DisplayFor(modelItem =&gt;item.OrderNo) &lt;/td&gt; &lt;td&gt; @Html.DisplayFor(modelItem =&gt; item.SubArea) &lt;/td&gt; &lt;td&gt; @Html.DisplayFor(modelItem =&gt; item.Description) &lt;/td&gt; &lt;/tr&gt; } } } &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>I could not find the problem. So Please Help me to implement row drag and drop using jquery. Also the updated order will be updated in the database.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload