我正在尝试来自http://www.trirand.com/blog/jqgrid/jqgrid.html的 jqGrid 示例。网格带有数据,但不应用默认样式(字体大小、不同块/行的高度等)。默认样式是指我在 trirand 站点中使用的示例中看到的样式。
我该如何解决?
谢谢 Vivek Ragunathan
我使用的代码:
<html>
<head>
<title>JQGrid</title>
<link rel='stylesheet' type='text/css' href='http://code.jquery.com/ui/1.10.3/themes/sunny/jquery-ui.css' />
<link rel='stylesheet' type='text/css' href='http://www.trirand.com/blog/jqgrid/themes/ui.jqgrid.css' />
<script type='text/javascript' src='http://localhost:82/testbed/resources/jquery-1.7.1.min.js'></script>
<script type='text/javascript' src='http://www.trirand.com/blog/jqgrid/js/jquery-ui-custom.min.js'></script>
<script type='text/javascript' src='http://www.trirand.com/blog/jqgrid/js/i18n/grid.locale-en.js'></script>
<script type='text/javascript' src='http://www.trirand.com/blog/jqgrid/js/jquery.jqGrid.js'></script>
<script type="text/javascript">
var lastsel2;
$(function () {
$("#list1").jqGrid({
caption: "Trying out jqGrid for Points",
url: <url>,
editurl: <edit url>,
mtype : "get",
datatype: "json",
colNames: ['id', 'Name', 'Age', 'Address'],
colModel: [
{ name:'id', index: 'id', width: 35, align:"left", editable: true, sorttype: 'int', editrules: { edithidden: true }, hidden: true },
{ name: 'name', index: 'name', width: 35, align:"left", editable: true, editoptions: { size: '20', maxlength: '255'} },
{ name: 'age', index: 'name', width: 35, align:"left", editable: true, editoptions: { size: '20', maxlength: '255'} },
{ name: 'address', index: 'address', width: 35, align:"left", editable: true, editoptions: { size: '20', maxlength: '255'} },
],
rowNum: 10,
autowidth: true,
height: 150,
rowList: [10, 20, 30, 50, 80, 100],
pager: '#pager1',
toolbar: [true,"top"],
sortname: 'created',
viewrecords: true,
altRows: true
});
$("#list1").jqGrid('navGrid', '#pager1', { edit: true, add: true, del: false });
});
}
</script>
</head>
<body>
<table id="list1"></table>
<div id="pager1"></div>
</body>