我有一个场景,我有一个包含数据的表。 我想介绍一个功能,如果我将表的一行拖到另一行,这两行的内容将合并到数据库和表中。 该表是:
<table class="table table-striped table-hover table-bordered" id="editable-sample">
<thead>
<tr>
<th></th>
<th>@Html.DisplayNameFor(model => model.Activitys[0].Activity_Text)</th>
<th>
@Html.DisplayNameFor(model => model.Activitys[0].Deliverable)
</th>
<th>
@Html.DisplayNameFor(model => model.Activitys[0].Project.Name)
</th>
<th>
@Html.DisplayNameFor(model => model.Activitys[0].ActivityType.Activity_Type)
</th>
<th>
@Html.DisplayNameFor(model => model.Activitys[0].Activity_Date)
</th>
</tr>
</thead>
<tbody>
@{List<int> MergedActivity = ViewBag.IsMerged;}
@foreach (var item in Model.Activitys)
{
DateTime sDate = item.Activity_Date;
string date = sDate.ToString("MM/dd/yyyy");
<tr class="">
<td>
<input type="checkbox" name="SelectedGroups" value="@item.ID" id="@item.ID" class="chk" />
</td>
<td>
<b><u>
@Html.ActionLink(StringTruncate.TruncateString(item.Activity_Text, 15, TruncateOptions.IncludeEllipsis), "Edit", "Activities", new { id = item.ID }, null)
</u></b>
@if (item.IsImported)
{
<i class="fa fa-anchor"></i>
}
@if (MergedActivity.Contains(item.ID))
{
<i class="fa fa-random"></i>
}
</td>
<td>
@StringTruncate.TruncateString(item.Deliverable,15, TruncateOptions.IncludeEllipsis)
@*@Html.DisplayFor(modelItem => item.Deliverable)*@
</td>
<td>
@StringTruncate.TruncateString(item.Project.Name,15, TruncateOptions.IncludeEllipsis)
</td>
<td>
@StringTruncate.TruncateString(item.ActivityType.Activity_Type, 9, TruncateOptions.IncludeEllipsis)
@*@Html.DisplayFor(modelItem => item.ActivityType.Activity_Type)*@
</td>
<td>
@date
</td>
</tr>
}
</tbody>
</table>
我需要一个jquery来实现使用拖放操作合并两行。 感谢