ASP.Net MVCを使用してjQueryブートグリッドを実装する際にいくつか問題があります。ソート、検索、ページ設定などの機能は実装できません。MVCでjQueryブートグリッドリクエストデータを処理する方法
これは私が私のコントローラに持っているものです。
public JsonResult IndexJson(BootgridRequestData model)
{
var contacts = (from x in db.ContactSet
select new
{
x.AccountId,
x.FirstName,
x.LastName,
x.FullName,
x.JobTitle,
x.ParentCustomerId,
x.EMailAddress1,
x.Telephone1,
x.MobilePhone,
x.Fax,
x.GenderCode,
x.BirthDate
}).ToList();
// This tResult throws a Non-invocable member cannot be used like a method error.
var tResult = BootgridResponseData<JsonResult>() {
current = model.current,
rowCount = model.rowCount,
rows = contacts,
total = contacts.Count
};
return Json(tResult, JsonRequestBehavior.AllowGet);
}
それから私は、次のヘルパークラスを持っている:
public class BootgridRequestData
{
public int current { get; set; }
public string rowCount { get; set; }
public string searchPhrase { get; set; }
public IEnumerable<SortData> sortItems { get; set; }
}
public class BootgridResponseData<T> where T : class
{
public int current { get; set; } //? current page
public int rowCount { get; set; } //? rows per page
public IEnumerable<T> rows { get; set; } //? items
public int total { get; set; } //? total rows for whole query
}
public class SortData
{
public string Field { get; set; } //? Field Name
public string Type { get; set; } //? ASC or DESC
}
私は本当にどこここから行くには余りにもよく分かりません。何かアドバイス?
を見て、私は私の 'VAR tResult = ...'で次のエラーを取得:method.' –
テイクのような '非呼び出し可能メンバーのBootgridResponseData」を使用することはできませんこの例で私のGitHubリポジトリ https://github.com/bmvr/MVC_BOOTGRID_EXAMPLE/tree/master/MVC_Bootgrid_exampleを見てください。 コードを実行したら、url /Example/ にアクセスしてください。 –
bmvr
'new'というキーワードがありませんでした:/ –