我面对JqGrid的问题。我已经完成了许多建议并遵循了同样的建议。但是,我仍然面临着这个问题
jquery.jqGrid.src.js:未捕获的TypeError:无法读取属性'整数'未定义的。
以下是代码:
我的参考文献:
<script src="../../SiteAssets/Script/jquery-1.12.2.min.js" type="text/javascript"></script>
<script src="../../SiteAssets/Script/grid.locale-en.js" type="text/javascript"></script>
<script src="../../SiteAssets/Script/jquery.jqGrid.min.js" type="text/javascript"></script>
<script src="../../SiteAssets/Script/jquery.jqGrid.src.js" type="text/javascript"></script>
<script src="../../SiteAssets/Script/jquery.SPServices-0.7.2.min.js" type="text/javascript"></script>
var Clientdata = [];
function ClientGriddisplay() {
$("#Clientgrid").jqGrid({
data: Clientdata,
datatype: "local",
colNames: ["Name","Age", "Location"],
colModel: [
{ name: 'Name', index: 'Name', width: 200,resizable: false },
{ name: 'Age', index: 'Age', width: 200,resizable: false },
{ name: 'Location', index: 'Location', width: 200,resizable: false },
],
rowNum: 10,
mtype:'Get',
loadonce:true,
rowList:[10,20,30],
pager:'#jQGridDemoPager',
sortname: 'id',
viewrecords: true,
sortorder: "desc",
caption: "Personal Details",
height:'auto',
gridview:true
});
}
$('#document').ready(function () {
//To load the client data from the sharepoint list.
GetClientList();
//To load the client data to the JQgrid
ClientGriddisplay();
});
function GetClientList() {
$().SPServices({
operation: "GetListItems",
async: false,
listName: "GridTest",
CAMLViewFields: "",
completefunc: buildClientarray
});
}
function buildClientarray(xData, status) {
$(xData.responseXML).SPFilterNode("z:row").each(function () {
Clientdata.push({
Name: $(this).attr("ows_Name"),
Age: $(this).attr("ows_Age"),
Location: $(this).attr("ows_Location"),
});
});
}