我以爲我會得到這個東西排序,但我嘗試在我的另一個應用程序中使用jqGrid,它不想工作。它甚至不會去提到的URL。它甚至不會顯示emptyrecords字符串,只是一個空的網格。
這是我在查看jqGrid再次與ASP.NET MVC3?
$("#list").jqGrid({
url: '/Customers/MyAccount/GetEnhancementRequests',
datatype: 'json',
type: 'POST',
colNames: ['ID', 'Requested By', 'Requested Date', 'Details', 'Progress'],
colModel: [
{ name: 'Id', index: 'ID', key: true, width: 55 },
{ name: 'CustomerName', index: 'CustomerName', width: 50 },
{ name: 'requestDate', index: 'requestDate', width: 50 },
{ name: 'details', index: 'details', width: 50 },
{ name: 'progress', index: 'progress', width: 50 }
],
pager: $("#pager"),
rowNum: 2,
rowList: [2, 10, 50, 100, 200],
sortname: 'ID',
viewrecords: true,
sortorder: 'desc',
caption: 'Enhancement Requests',
imgpath: '/Content/images',
width: 1000,
height: 500,
emptyrecords: 'No enhancements have been submitted',
jsonReader: { repeatitems: false }
});
$("#list").jqGrid('navGrid', '#pager',
{ edit: false, add: false, del: false },
{},
{},
{},
{ multipleSearch: true, multipleGroup: true }
);
而且我已經改變了我的控制器行動,只是這個
[HttpPost]
public JsonResult GetEnhancementRequests(string sidx, string sord, int page, int rows, bool _search, string filters)
{
var jsonData = new
{
total = 1,
page = page,
records = 1,
rows = (
new {
id = 1,
cell = new string[]{
"1", "RequestedBy", DateTime.Now.ToShortDateString(), "Lots of details", "and even some progress"}
})
};
return Json(jsonData);
}
我有在控制器動作斷點,但它不是」即使進入方法。任何見解?
編輯:忘了補充,我有以下參考腳本。正如你所看到的,我已經得到了所有REQ文件
<link href="../../../../Scripts/css/custom-theme/jquery-ui-1.8.16.custom.css" rel="stylesheet" type="text/css" />
<link href="../../../../Scripts/css/ui.jqgrid.css" rel="stylesheet" type="text/css" />
<link href="../../../../Scripts/ui.multiselect.css" rel="stylesheet" type="text/css" />
<script src="../../../../Scripts/jquery-1.6.4.min.js" type="text/javascript"></script>
<script src="../../../../Scripts/jquery-ui-1.8.15.min.js" type="text/javascript"></script>
<script src="../../../../Scripts/jquery-ui-1.8.16.custom.min.js" type="text/javascript"></script>
<script src="../../../../Scripts/grid.locale-en.js" type="text/javascript"></script>
<script src="../../../../Scripts/ui.multiselect.js" type="text/javascript"></script>
<script src="../../../../Scripts/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="../../../../Scripts/jquery.tablednd.js" type="text/javascript"></script>
你可以請你也發佈網格請求的網址示例輸出? –