-1
jQuery UIを使用してテーブルグリッドをソート可能にしています。コードはエラーを表示しませんが、ソート可能な関数は動作していないようです。これは私の要素が並べ替えられていないことを意味します。私はmvc(views/razor)プロジェクトでこのメソッドを使用したことはありません。jqueryはテーブルとtrの幅でソートできません。aps.net mvcビューでは機能しません。
誰でも私に助けや助けを与えることができれば幸いです。
ありがとうございました。
script type="text/javascript">
$('td, th', '#MenuItem').each(function() {
var cell = $(this);
cell.width(cell.width());
});
$('#MenuItem tbody').sortable().disableSelection();
<table id = "MenuItem" class="promo full-width alternate-rows" style="text-align: center;">
<tr>
<th>Prode Code
</th>
<th>ProdeTemplate
</th>
<th>Description <!-- JACK EDIT -->
</th>
<th>Action</th>
</tr>
<tbody>
@foreach (var item in Model.IndexListitem)
{
<tr>
<td class="center-text">
@Html.DisplayFor(modelItem => item.ProductCode)
</td>
<td>
@Html.DisplayFor(modelItem => item.ProdeTemplate.Description)
</td>
<td>
@Html.DisplayFor(modelItem => item.Description)
</td>
<td class="center-text nowrap">
@Html.ActionLink(" ", "Edit", new { id = item.ProdeID }, new { title = "Edit", @class = "anchor-icon-no-text edit" })
@Html.ActionLink(" ", "Details", new { id = item.ProdeID }, new { title = "Details", @class = "anchor-icon-no-text details" })
@Html.ActionLink(" ", "Delete", new { id = item.ProdeID }, new { title = "Delete", @class = "anchor-icon-no-text delete" })
</td>
</tr>
}
</tbody>
</table>