Add/Edit 단추를 추가하는 기능을 제외하고 NuGet의 우수한 라이브러리 Lib.Web.Mvc.JQuery.JqGrid
이 작동합니다. 나는 테이블 초기화하려면 다음 코드를 사용하고 있습니다 :Lib.Web.Mvc.JQuery.JqGrid 추가/편집 단추가 나타나지 않습니다.
@{
var grid = new JqGridHelper<TVTViewModel>("tuples",
dataType: JqGridDataTypes.Json,
methodType: JqGridMethodTypes.Post,
pager: true,
rowsNumber: 50,
sortingName: "RecordId",
sortingOrder: JqGridSortingOrders.Asc,
url: Url.Action("Details", new { nctId = Model.NctId }),
viewRecords: true,
cellEditingEnabled: true,
cellEditingSubmitMode: JqGridCellEditingSubmitModes.ClientArray
)
.AddActionsColumn("Actions", width: 25,
inlineEditingOptions: new JqGridInlineNavigatorActionOptions { Keys = true },
editButton: false,
deleteOptions: new JqGridNavigatorDeleteActionOptions { Url = Url.Action("Test", "Test") });
}
을 다음과 같은 컨트롤러 응답 코드 :
JqGridResponse response = new JqGridResponse()
{
TotalPagesCount = (int)Math.Ceiling((float)totalRecordsCount/(float)request.RecordsCount),
PageIndex = request.PageIndex,
TotalRecordsCount = totalRecordsCount
};
int i = 0;
foreach (TVTViewModel v in viewModels)
{
v.RecordId = i;
response.Records.Add(new JqGridRecord<TVTViewModel>(v.RecordId.ToString(), v));
i++;
}
return new JqGridJsonResult() { Data = response };
하지만 페이지를 렌더링 할 때, 추가 컬럼은 "정의되지 않은"모든에 대한로 나타 열의 행.
온라인으로 여러 곳에서 response
에 내가 시도한 response.Reader.RepeatItems = false;
을 가지고 있는지 확인하는 것이 좋습니다 (작동하지 않았습니다). 다른 제안?