我一直在尋找的最後幾個小時,不幸的是我似乎無法找到如何填充與動作編輯一個DataTable和使用.NET和MVC刪除鏈接欄的例子。jQuery的數據表ActionLink的如何添加
這是我到目前爲止,如何添加一個操作鏈接?我錯過了什麼?
<script type="text/javascript">
$(document).ready(function() {
$('#myDataTable').dataTable({
bProcessing: true,
sAjaxSource: '@Url.Action("Index1", "Default1")'
});
});
</script>
<div id="container">
<div id="demo">
<table id="myDataTable">
<thead>
<tr>
<th>
RoleId
</th>
<th>
RoleName
</th>
<th>
UserId
</th>
<th>
UserName
</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
我想在最後一列添加這個;
<td>
@Html.ActionLink("Edit", "Edit", new {id=item.PrimaryKey}) |
@Html.ActionLink("Details", "Details", new { id=item.PrimaryKey }) |
@Html.ActionLink("Delete", "Delete", new { id=item.PrimaryKey })
</td>
但無法弄清楚如何去做。
「fnRender」 已被棄用。改用「mRender」。 http://www.datatables.net/usage/columns – asunrey