Permalink
Browse files

Integrate the jQuery DataTables plugin.

  • Loading branch information...
gilles-leblanc committed Oct 29, 2016
1 parent 62672ea commit c19ce075b83359beef41abfe95f2d16228d1bed5
@@ -1,6 +1,6 @@
@model Ajax2.Models.DepartmentsModel
<table class="table table-striped">
<table id="deparment-table" class="table table-striped">
<thead>
<tr>
<th>Id</th>
@@ -11,7 +11,8 @@
{
HttpMethod = "POST",
InsertionMode = InsertionMode.Replace,
UpdateTargetId = "department-table"
UpdateTargetId = "department-table",
OnSuccess = "tableUpdated",
}))
{
<label>Filter: </label>
@@ -22,3 +23,16 @@
<div id="department-table">
@{ Html.RenderPartial("DepartmentsTablePartial", Model); }
</div>
@section Scripts
{
<script type="text/javascript">
$(document).ready(function () {
$('#deparment-table').DataTable();
});
function tableUpdated() {
$('#deparment-table').DataTable().draw();
}
</script>
}
@@ -6,6 +6,7 @@
<title>@ViewBag.Title - My ASP.NET Application</title>
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/1.10.12/css/jquery.dataTables.css">
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
@@ -30,6 +31,7 @@
</div>
@Scripts.Render("~/bundles/jquery")
<script type="text/javascript" charset="utf8" src="//cdn.datatables.net/1.10.12/js/jquery.dataTables.js"></script>
@Scripts.Render("~/bundles/bootstrap")
@RenderSection("scripts", required: false)
</body>

0 comments on commit c19ce07

Please sign in to comment.