0
我_Layout.cshtml這樣jqGrid不渲染mvc3剃鬚刀?
<head>
<meta charset="utf-8" />
<title>@ViewBag.Title - E-Reader Statistics</title>
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<meta name="viewport" content="width=device-width" />
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
@* @Scripts.Render("~/bundles/jquery")*@
<link href="~/jqGrid/css/ui.jqgrid.css" rel="stylesheet" />
<script src="~/jqGrid/js/i18n/grid.locale-en.js"></script>
<script src="~/jqGrid/js/jquery-1.9.0.min.js"></script>
<script src="~/jqGrid/js/jquery.jqGrid.min.js"></script>
<script src="~/jqGrid/js/jquery.jqGrid.src.js"></script>
</head>
在Index.chtml
@model List<LSStatisticalReport.ViewModels.GSViewModel>
@{
ViewBag.Title = "Index";
}
@*<h2>General Statistics</h2>*@
<script type="text/javascript">
// var jq = $.noConflict();
$(document).ready(function() {
var genStatGrid = $('#list');
genStatGrid.jqGrid({
caption: "General Statistics",
url: '/Statistics/GetRecords/',
datatype: "json",
contentType: "application/json; charset-utf-8",
mtype: 'POST',
colNames: ['Student', 'Teacher', 'Date'],
colModel: [
{ name: 'studentDesignation' },
{ name: 'teacherDesignation' },
{ name: 'dateLength' },
],
rowNum: 5
});
});
</script>
但是,當我運行我得到的控制檯錯誤的項目:
「遺漏的類型錯誤:對象[對象對象]沒有方法'jqGrid'「
'jquery-1.9.0.min.js'應該寫在'grid.locale-en.js'之前 –