I\'m new in jqgrid, I\'m just trying thes example to work. I have a html file only, nothing more. When I ran this file, array data is not showing. What am I missing here? Th
This are the css and js to include that do the trick for me. Very important to include grid.base.js
Try this friends
<link rel="stylesheet" type="text/css" href="css/ui.jqgrid.css" />
<script src="js/jquery-1.11.0.min.js" type="text/javascript"></script>
<script src="js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="js/jquery.jqGrid.min.js" type="text/javascript"></script>
<script type="text/javascript">
var mydata = [{
Sno: "1",
StudentName: "Ricky",
DateOfJoining: "05/12/2014"
}, {
Sno: "3",
StudentName: "Hyden",
DateOfJoining: "06/12/2014"
}, {
Sno: "4",
StudentName: "Gill Crist",
DateOfJoining:"04/12/2014"
}, {
Sno: "2",
StudentName: "Lee",
DateOfJoining: "07/12/2014"
}];
$(function () {
$("#grid").jqGrid({
data: mydata,
datatype: "local",
colNames: ["Sno", "StudentName", "DateOfJoining"],
colModel: [
{ name: "Sno", width: 100},
{ name: "StudentName", width: 160 },
{ name: "DateOfJoining", width: 150, align: "right" }
],
pager: "#pager",
rowNum: 2,
rowList: [1, 2, 3],
sortname: "Sno",
sortorder: "desc",
viewrecords: true,
gridview: true,
autoencode: true,
caption: "Student Details"
});
});
</script>
</head>
<body>
<table id="grid"></table>
<div id="pager"></div>
</body>