Ajax load series/index

pull/2/head
Mark McDowall 12 years ago
parent 253d0919e0
commit ebad87b81b

@ -38,11 +38,16 @@ namespace NzbDrone.Web.Controllers
}
public ActionResult Index()
{
return View();
}
[HttpGet]
public ActionResult Series()
{
var series = GetSeriesModels(_seriesProvider.GetAllSeriesWithEpisodeCount());
var serialized = new JavaScriptSerializer().Serialize(series);
return View((object)serialized);
return Json(new { aaData = series }, JsonRequestBehavior.AllowGet);
}
public ActionResult Edit(int seriesId)

@ -1,5 +1,4 @@
@using NzbDrone.Web.Helpers
@model string
@{ViewBag.Title = "NzbDrone";}
@section HeaderContent
@ -76,9 +75,7 @@
<th style="width: 100px">Episodes</th>
@*Commands Column*@
<th style="width: 80px">
</th>
<th style="width: 80px"></th>
</tr>
</thead>
<tbody>
@ -111,8 +108,9 @@
$('#seriesGrid').removeClass('hidden-grid');
oTable = $('.dataTablesGrid').dataTable({
"sAjaxSource": "Series/Series",
"bServerSide": false,
"bShowAll": false,
"aaData": @Html.Raw(Model),
"bPaginate": false,
"bLengthChange": false,
"bFilter": false,

Loading…
Cancel
Save