JqGrid でのエントリの並べ替えに問題があります。Orderby が機能しないようです。コードにブレークポイントを設定したところ、orderby が要素の順序を変更しないことに気付きました。何が間違っている可能性がありますか?
MySQL (DbLinq プロジェクト) で LINQ to SQL を使用しています。
私のアクションコード:
public ActionResult All(string sidx, string sord, int page, int rows)
{
var tickets = ZTRepository.GetAllTickets().OrderBy(sidx + " " + sord).ToList();
var rowdata = (
from ticket in tickets
select new {
i = ticket.ID,
cell = new String[] {
ticket.ID.ToString(), ticket.Hardware, ticket.Issue, ticket.IssueDetails, ticket.RequestedBy, ticket.AssignedTo, ticket.Priority.ToString(), ticket.State
}
}).ToArray();
var jsonData = new
{
total = 1, // we'll implement later
page = page,
records = tickets.Count(),
rows = rowdata
};
return Json(jsonData, JsonRequestBehavior.AllowGet);
}