EnVisageOnline/Main-RMO/Source/jQuery.DataTables.Mvc/ControllerExtensions.cs

34 lines
1.1 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using System.Collections.ObjectModel;
namespace jQuery.DataTables.Mvc
{
public static class ControllerExtensions
{
public static JsonResult DataTablesJson<T>(this Controller controller, IEnumerable<T> items,
int totalRecords,
int totalDisplayRecords,
int sEcho,
ReadOnlyCollection<string> sSearch_)
{
var result = new JsonResult();
result.Data = new JQueryDataTablesResponse<T>(items, totalRecords, totalDisplayRecords, sEcho, sSearch_);
return result;
}
public static JsonResult DataTablesJson<T>(this Controller controller, IEnumerable<T> items,
int totalRecords,
int totalDisplayRecords,
int sEcho)
{
var result = new JsonResult();
result.Data = new JQueryDataTablesResponse<T>(items, totalRecords, totalDisplayRecords, sEcho);
return result;
}
}
}